summaryrefslogtreecommitdiffstats
path: root/lib/libnv
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2014-01-03 09:07:03 +0000
committerpjd <pjd@FreeBSD.org>2014-01-03 09:07:03 +0000
commitedb2f6bf1320ec6c580739607fafaf0df5a8c7f9 (patch)
tree524d30d78c2d099d645b892ce41dfe3ea962ce2b /lib/libnv
parent3c3918c7e97949a14ee47c106e3e137639c7968a (diff)
downloadFreeBSD-src-edb2f6bf1320ec6c580739607fafaf0df5a8c7f9.zip
FreeBSD-src-edb2f6bf1320ec6c580739607fafaf0df5a8c7f9.tar.gz
MFp4 @1189711:
Fix resource leaks on nvlist_destroy(). Reported by: Mariusz Zaborski <oshogbo@FreeBSD.org> MFC after: 3 days
Diffstat (limited to 'lib/libnv')
-rw-r--r--lib/libnv/nvlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libnv/nvlist.c b/lib/libnv/nvlist.c
index 299d60e..ba809f5 100644
--- a/lib/libnv/nvlist.c
+++ b/lib/libnv/nvlist.c
@@ -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);
OpenPOWER on IntegriCloud