Date: Mon, 18 Jun 2018 22:21:29 +0000 (UTC) From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335344 - head/sys/contrib/libnv Message-ID: <201806182221.w5IMLTsa019339@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806182221.w5IMLTsa019339>