summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorcao <[email protected]>2016-10-01 06:56:17 +0800
committerBrian Behlendorf <[email protected]>2016-09-30 15:56:17 -0700
commit0a8f18f9327a6275759393c5fc2f14664f172add (patch)
treec01629706eaec056f824038ddca0763a974f306c /lib
parent470f12d631764d3706e2702762e9f3ae924cab43 (diff)
Fix coverity defects: CID 147563, 147560
coverity scan CID:147563, Type:dereference null return value coverity scan CID:147560, Type:dereference null return value Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5168
Diffstat (limited to 'lib')
-rwxr-xr-xlib/libzfs/libzfs_dataset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index 84fe71734..6b09cb6da 100755
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -2262,6 +2262,11 @@ zfs_get_clones_nvl(zfs_handle_t *zhp)
(void) strsep(&cp, "/@");
root = zfs_open(zhp->zfs_hdl, pool,
ZFS_TYPE_FILESYSTEM);
+ if (root == NULL) {
+ nvlist_free(nv);
+ nvlist_free(value);
+ return (NULL);
+ }
(void) get_clones_cb(root, &gca);
}