All of lore.kernel.org
 help / color / mirror / Atom feed
* Memory leak in libselinux/src/label_file.c
@ 2009-04-03  4:58 Hiroshi Shinji
  2009-05-07 19:20 ` Chad Sellers
  0 siblings, 1 reply; 3+ messages in thread
From: Hiroshi Shinji @ 2009-04-03  4:58 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 102 bytes --]

Hi,

I found memory leak in libselinux/src/label_file.c.
Please fix it.

Regards,

-- 
Hiroshi Shinji

[-- Attachment #2: label_file.patch --]
[-- Type: text/x-diff, Size: 462 bytes --]

diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index 5043f09..b5e904f 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -299,6 +299,8 @@ static int process_line(struct selabel_handle *rec,
 		COMPAT_LOG(SELINUX_WARNING,
 			    "%s:  line %d is missing fields, skipping\n", path,
 			    lineno);
+		if (items == 1)
+			free(regex);
 		return 0;
 	} else if (items == 2) {
 		/* The type field is optional. */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-18 15:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-03  4:58 Memory leak in libselinux/src/label_file.c Hiroshi Shinji
2009-05-07 19:20 ` Chad Sellers
2009-05-18 15:30   ` Joshua Brindle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.