Skip to contentSkip to conversation

libsepol resource leak

PATCH In review [email protected] 3 participants 3 messages Aug 18, 2005 – Aug 22, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsepol resource leak

(I am sending out four patches to libsepol. Another 6 or so which I investigated were not actual bugs. This leaves me with a little over half to still look at, hopefully tomorrow. After that I'll hop to libsemanage or the kernel code).

This patch fixes a bug found by Coverity:

On error in sepol_context_to_string(), 'str' is not freed.

context_record.c +2 -0
Index: src/context_record.c
===================================================================
@@ -253,5 +253,7 @@ char* sepol_context_to_string(sepol_cont
 
 	err:
 	DEBUG(__FUNCTION__, "could not convert context to string\n");
+	if (str)
+		free(str);
 	return NULL;
 }

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 4 lines · On Thu, 2005-08-18 at 13:20 -0500, [email protected] wrote:

(I am sending out four patches to libsepol. Another 6 or so which I investigated were not actual bugs. This leaves me with a little over half to still look at, hopefully tomorrow. After that I'll hop to libsemanage or the kernel code).

Thanks, merged. Did you look at policycoreutils?

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 7 lines · Stephen Smalley
Quoted 4 lines · On Thu, 2005-08-18 at 13:20 -0500, [email protected] wrote:

(I am sending out four patches to libsepol. Another 6 or so which I investigated were not actual bugs. This leaves me with a little over half to still look at, hopefully tomorrow. After that I'll hop to libsemanage or the kernel code).

Thanks, merged. Did you look at policycoreutils?

No, I haven't looked at that yet. Right now I'm sorting through a huge mess of false positives in libsepol...

-serge

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.