From: <ssm...@us...> - 2008-04-18 13:57:46
|
Revision: 2861 http://selinux.svn.sourceforge.net/selinux/?rev=2861&view=rev Author: ssmalley Date: 2008-04-18 06:47:18 -0700 (Fri, 18 Apr 2008) Log Message: ----------- Author: Eamon Walsh Email: ew...@ty... Subject: libselinux/matchpathcon has a memory leak Date: Fri, 14 Mar 2008 15:27:11 -0400 Here is a new version of the patch. The clearing out of the data instead of freeing it is a leftover from when that was a global variable. That was the cause of the leak I thought was the result of a missing matchpathcon_fini(). Signed-off-by: Eamon Walsh <ew...@ty...> Acked-by: Stephen Smalley <sd...@ty...> Modified Paths: -------------- trunk/libselinux/src/label.c trunk/libselinux/src/label_file.c Modified: trunk/libselinux/src/label.c =================================================================== --- trunk/libselinux/src/label.c 2008-03-31 14:22:40 UTC (rev 2860) +++ trunk/libselinux/src/label.c 2008-04-18 13:47:18 UTC (rev 2861) @@ -95,7 +95,7 @@ if (compat_validate(rec, lr, "file_contexts", 0)) return NULL; - if (translating && + if (translating && !lr->ctx_trans && selinux_raw_to_trans_context(lr->ctx_raw, &lr->ctx_trans)) return NULL; Modified: trunk/libselinux/src/label_file.c =================================================================== --- trunk/libselinux/src/label_file.c 2008-03-31 14:22:40 UTC (rev 2860) +++ trunk/libselinux/src/label_file.c 2008-04-18 13:47:18 UTC (rev 2861) @@ -562,7 +562,7 @@ if (data->stem_arr) free(data->stem_arr); - memset(data, 0, sizeof(*data)); + free(data); } static struct selabel_lookup_rec *lookup(struct selabel_handle *rec, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |