Skip to content

Commit

Permalink
libnv: clean parent in nvlist_array when removing it.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
oshogbo committed Jun 18, 2018
1 parent 0838a64 commit a829b23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sys/contrib/libnv/nvpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a829b23

Please sign in to comment.