summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libzfs
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-11-13 09:47:37 +0000
committermav <mav@FreeBSD.org>2015-11-13 09:47:37 +0000
commit503dafdd831dca9eee6df7095113953c9a1c5c35 (patch)
tree6198bbdea111e944e61942e8f9f14573bf4dfab4 /cddl/contrib/opensolaris/lib/libzfs
parentb470ddeee26e2e43483e1937c01e04874b5431b4 (diff)
downloadFreeBSD-src-503dafdd831dca9eee6df7095113953c9a1c5c35.zip
FreeBSD-src-503dafdd831dca9eee6df7095113953c9a1c5c35.tar.gz
MFC r289531: 5847 libzfs_diff should check zfs_prop_get() return
Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Albert Lee <trisk@omniti.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Alexander Eremin <a.eremin@nexenta.com> illumos/illumos-gate@8430278980a48338e04c7dd52b495b7f1551367a
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
index ab2007d..3b17579 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -624,9 +625,12 @@ get_snapshot_names(differ_info_t *di, const char *fromsnap,
zhp = zfs_open(hdl, di->ds, ZFS_TYPE_FILESYSTEM);
while (zhp != NULL) {
- (void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN,
- origin, sizeof (origin), &src, NULL, 0, B_FALSE);
-
+ if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin,
+ sizeof (origin), &src, NULL, 0, B_FALSE) != 0) {
+ (void) zfs_close(zhp);
+ zhp = NULL;
+ break;
+ }
if (strncmp(origin, fromsnap, fsnlen) == 0)
break;
OpenPOWER on IntegriCloud