MFp4 @1189711:

Fix resource leaks on nvlist_destroy().

Reported by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2014-01-03 09:07:03 +00:00
parent 2f95141e5f
commit 3ae9762b9a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260222

View file

@ -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);