libnv: fix double free

In r343986 we introduced a double free. The structure was already
freed fixed in the r302966. This problem was introduced
because the GitHub version was out of sync with the FreeBSD one.

Submitted by:	Mindaugas Rasiukevicius <rmind@netbsd.org>
MFC with:	r343986
This commit is contained in:
Mariusz Zaborski 2019-02-17 18:26:27 +00:00
parent a070559721
commit d97753b5c8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=344235

View File

@ -229,14 +229,6 @@ nvpair_remove_nvlist_array(nvpair_t *nvp)
nvlarray = __DECONST(nvlist_t **,
nvpair_get_nvlist_array(nvp, &count));
for (i = 0; i < count; i++) {
nvlist_t *nvl;
nvpair_t *nnvp;
nvl = nvlarray[i];
nnvp = nvlist_get_array_next_nvpair(nvl);
if (nnvp != NULL) {
nvpair_free_structure(nnvp);
}
nvlist_set_array_next(nvl, NULL);
nvlist_set_parent(nvl, NULL);
}