Date: Mon, 23 Jul 2012 20:20:56 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r239710 - in soc2012/gmiller/locking-head: . lib/libwitness Message-ID: <20120723202056.1B0F81065680@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gmiller Date: Mon Jul 23 20:20:55 2012 New Revision: 239710 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=239710 Log: r239750@FreeBSD-dev: root | 2012-07-23 13:22:31 -0500 Fix a memory leak with blessed locks. Modified: soc2012/gmiller/locking-head/ (props changed) soc2012/gmiller/locking-head/lib/libwitness/lockinfo.c Modified: soc2012/gmiller/locking-head/lib/libwitness/lockinfo.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libwitness/lockinfo.c Mon Jul 23 20:20:43 2012 (r239709) +++ soc2012/gmiller/locking-head/lib/libwitness/lockinfo.c Mon Jul 23 20:20:55 2012 (r239710) @@ -88,6 +88,8 @@ reset_lock_info(void) { struct lock_info *info; + struct blessing *bless; + struct blessing *bless_temp; while (!SLIST_EMPTY(&lock_info_head)) { info = SLIST_FIRST(&lock_info_head); @@ -97,6 +99,12 @@ if (info->name != NULL) { free(info->name); } + + SLIST_FOREACH_SAFE(bless, &info->bless_head, bless_next, + bless_temp) { + free(bless); + } + free(info); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120723202056.1B0F81065680>