socsvn commit: r239710 - in soc2012/gmiller/locking-head: . lib/libwitness

gmiller at FreeBSD.org gmiller at FreeBSD.org
Mon Jul 23 20:20:58 UTC 2012


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 at 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);
 	}
 }


More information about the svn-soc-all mailing list