libnv: clean parent in nvlist_array when removing it.

When we are removing element form the nvlist we should also clean parent,
because the array is not a part of the nvlist anymore.

Submitted by:	Mindaugas Rasiukevicius <rmind@netbsd.org>
This commit is contained in:
Mariusz Zaborski 2018-06-18 22:21:28 +00:00
parent d82e41b6b8
commit c11c5fb874
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335344

View File

@ -206,8 +206,10 @@ nvpair_remove_nvlist_array(nvpair_t *nvp)
/* XXX: DECONST is bad, mkay? */
nvlarray = __DECONST(nvlist_t **,
nvpair_get_nvlist_array(nvp, &count));
for (i = 0; i < count; i++)
for (i = 0; i < count; i++) {
nvlist_set_array_next(nvlarray[i], NULL);
nvlist_set_parent(nvlarray[i], NULL);
}
}
void