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 <rm...@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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to