diff options
author | pjd <pjd@FreeBSD.org> | 2014-01-03 09:07:03 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2014-01-03 09:07:03 +0000 |
commit | edb2f6bf1320ec6c580739607fafaf0df5a8c7f9 (patch) | |
tree | 524d30d78c2d099d645b892ce41dfe3ea962ce2b /lib/libnv | |
parent | 3c3918c7e97949a14ee47c106e3e137639c7968a (diff) | |
download | FreeBSD-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.c | 4 |
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); |