All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libselinux: Free memory when processing media and x specfiles
@ 2015-09-15 13:51 Richard Haines
  2015-09-15 14:40 ` Stephen Smalley
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Haines @ 2015-09-15 13:51 UTC (permalink / raw)
  To: selinux

Ensure all memory is freed - checked using valgrind

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
---
 libselinux/src/label_media.c | 2 +-
 libselinux/src/label_x.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libselinux/src/label_media.c b/libselinux/src/label_media.c
index 725d5bd..c589ca3 100644
--- a/libselinux/src/label_media.c
+++ b/libselinux/src/label_media.c
@@ -161,7 +161,7 @@ static void close(struct selabel_handle *rec)
 	if (spec_arr)
 	    free(spec_arr);
 
-	memset(data, 0, sizeof(*data));
+	free(data);
 }
 
 static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,
diff --git a/libselinux/src/label_x.c b/libselinux/src/label_x.c
index 3f2ee1c..3d13b23 100644
--- a/libselinux/src/label_x.c
+++ b/libselinux/src/label_x.c
@@ -188,7 +188,7 @@ static void close(struct selabel_handle *rec)
 	if (spec_arr)
 	    free(spec_arr);
 
-	memset(data, 0, sizeof(*data));
+	free(data);
 }
 
 static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,
-- 
2.4.3

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

end of thread, other threads:[~2015-09-15 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15 13:51 [PATCH] libselinux: Free memory when processing media and x specfiles Richard Haines
2015-09-15 14:40 ` Stephen Smalley

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.