restorecond memory leaks
PATCH 1/1 restorecond memory leaks
Hi,
Attached is a patch addressing memory leaks in restorecond. It still consumes way too much memory, but this fixes all know leaks and valgrind now reports all memory freed at exit.
Signed-off-by Steve Grubb <[email protected]>
____________________________________________________________________________________
No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail
restorecond/restorecond.c +2 -0
@@ -483,6 +483,8 @@ int main(int argc, char **argv)watch_list_free (master_fd);close (master_fd); +matchpathcon_fini (); +utmpwatcher_free ();if (pidfile)unlink (pidfile);
restorecond/utmpwatcher.c +6 -0
@@ -101,6 +101,12 @@ void utmpwatcher_add(int inotify_fd, conwatch_file (inotify_fd, path); } +void utmpwatcher_free (void ) +{ +if (utmp_ptr) +strings_list_free (utmp_ptr); +} +#ifdef TEST int main (int argc,char **argv) {
restorecond/utmpwatcher.h +1 -0
@@ -25,5 +25,6 @@unsigned int utmpwatcher_handle (int inotify_fd,int wd);void utmpwatcher_add (int inotify_fd,const char *path); +void utmpwatcher_free (void );#endif
Quoted 7 lines · Steve G
Hi,
Attached is a patch addressing memory leaks in restorecond. It still consumes way too much memory, but this fixes all know leaks and valgrind now reports all memory freed at exit.
Signed-off-by Steve Grubb <[email protected]>
Thanks, merged into -trunk and -stable.
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.