Module Name: src Committed By: rmind Date: Fri Feb 15 22:49:24 UTC 2019
Modified Files: src/sys/external/bsd/libnv/dist: nvpair.c Log Message: nvpair_remove_nvlist_array: revert part of the rev 1.4 change (it was applied by mistake because the libnv upsteam code on Github has deviated from FreeBSD, i.e. it has a different nvlist_set_array_next() logic). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/libnv/dist/nvpair.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/libnv/dist/nvpair.c diff -u src/sys/external/bsd/libnv/dist/nvpair.c:1.5 src/sys/external/bsd/libnv/dist/nvpair.c:1.6 --- src/sys/external/bsd/libnv/dist/nvpair.c:1.5 Tue Feb 12 12:52:49 2019 +++ src/sys/external/bsd/libnv/dist/nvpair.c Fri Feb 15 22:49:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nvpair.c,v 1.5 2019/02/12 12:52:49 rmind Exp $ */ +/* $NetBSD: nvpair.c,v 1.6 2019/02/15 22:49:24 rmind Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD @@ -36,7 +36,7 @@ #ifdef __FreeBSD__ __FBSDID("$FreeBSD: head/sys/contrib/libnv/nvpair.c 335382 2018-06-19 18:43:02Z lwhsu $"); #else -__RCSID("$NetBSD: nvpair.c,v 1.5 2019/02/12 12:52:49 rmind Exp $"); +__RCSID("$NetBSD: nvpair.c,v 1.6 2019/02/15 22:49:24 rmind Exp $"); #endif #include <sys/param.h> @@ -251,16 +251,8 @@ nvpair_remove_nvlist_array(nvpair_t *nvp nvlarray = __DECONST(nvlist_t **, nvpair_get_nvlist_array(nvp, &count)); for (i = 0; i < count; i++) { - nvlist_t *nvl; - nvpair_t *nnvp; - - nvl = nvlarray[i]; - nnvp = nvlist_get_array_next_nvpair(nvl); - if (nnvp != NULL) { - nvpair_free_structure(nnvp); - } - nvlist_set_array_next(nvl, NULL); - nvlist_set_parent(nvl, NULL); + nvlist_set_array_next(nvlarray[i], NULL); + nvlist_set_parent(nvlarray[i], NULL); } }