From owner-svn-soc-all@FreeBSD.ORG Mon Jul 23 20:20:58 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 1B0F81065680 for ; Mon, 23 Jul 2012 20:20:56 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 23 Jul 2012 20:20:56 +0000 Date: Mon, 23 Jul 2012 20:20:56 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120723202056.1B0F81065680@hub.freebsd.org> Cc: Subject: socsvn commit: r239710 - in soc2012/gmiller/locking-head: . lib/libwitness X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 20:20:58 -0000 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); } }