summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2014-09-18 22:34:52 +0000
committerpjd <pjd@FreeBSD.org>2014-09-18 22:34:52 +0000
commit094cca2b36ac9809749d6a0b76bcd37556939c00 (patch)
treeb3145cc10bca2a7bf8cbeb917199eedd0236ac3b
parent2286325b1ed76654f3af1382270d4919a67b2c5f (diff)
downloadFreeBSD-src-094cca2b36ac9809749d6a0b76bcd37556939c00.zip
FreeBSD-src-094cca2b36ac9809749d6a0b76bcd37556939c00.tar.gz
Don't use nvl in case of a failure.
Reported by: Coverity CID: 1238922
-rw-r--r--lib/libnv/nvpair.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libnv/nvpair.c b/lib/libnv/nvpair.c
index b4be331..8ff8538 100644
--- a/lib/libnv/nvpair.c
+++ b/lib/libnv/nvpair.c
@@ -963,7 +963,8 @@ nvpair_createv_nvlist(const nvlist_t *value, const char *namefmt,
namefmt, nameap);
if (nvp == NULL)
nvlist_destroy(nvl);
- nvlist_set_parent(nvl, nvp);
+ else
+ nvlist_set_parent(nvl, nvp);
return (nvp);
}
OpenPOWER on IntegriCloud