svn commit: r260222 - head/lib/libnv

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Jan 3 09:07:03 UTC 2014


Author: pjd
Date: Fri Jan  3 09:07:03 2014
New Revision: 260222
URL: http://svnweb.freebsd.org/changeset/base/260222

Log:
  MFp4 @1189711:
  
  Fix resource leaks on nvlist_destroy().
  
  Reported by:	Mariusz Zaborski <oshogbo at FreeBSD.org>
  MFC after:	3 days

Modified:
  head/lib/libnv/nvlist.c

Modified: head/lib/libnv/nvlist.c
==============================================================================
--- head/lib/libnv/nvlist.c	Fri Jan  3 08:31:42 2014	(r260221)
+++ head/lib/libnv/nvlist.c	Fri Jan  3 09:07:03 2014	(r260222)
@@ -125,8 +125,10 @@ nvlist_destroy(nvlist_t *nvl)
 
 	NVLIST_ASSERT(nvl);
 
-	while ((nvp = nvlist_first_nvpair(nvl)) != NULL)
+	while ((nvp = nvlist_first_nvpair(nvl)) != NULL) {
 		nvlist_remove_nvpair(nvl, nvp);
+		nvpair_free(nvp);
+	}
 	nvl->nvl_magic = 0;
 	free(nvl);
 


More information about the svn-src-all mailing list