svn commit: r335344 - head/sys/contrib/libnv
Mariusz Zaborski
oshogbo at FreeBSD.org
Mon Jun 18 22:21:30 UTC 2018
Author: oshogbo
Date: Mon Jun 18 22:21:28 2018
New Revision: 335344
URL: https://svnweb.freebsd.org/changeset/base/335344
Log:
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 at netbsd.org>
Modified:
head/sys/contrib/libnv/nvpair.c
Modified: head/sys/contrib/libnv/nvpair.c
==============================================================================
--- head/sys/contrib/libnv/nvpair.c Mon Jun 18 21:26:58 2018 (r335343)
+++ head/sys/contrib/libnv/nvpair.c Mon Jun 18 22:21:28 2018 (r335344)
@@ -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
More information about the svn-src-all
mailing list