aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/zfs/dsl_prop.c4
-rw-r--r--module/zfs/zfs_ioctl.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/module/zfs/dsl_prop.c b/module/zfs/dsl_prop.c
index 24836000f..ece1e1975 100644
--- a/module/zfs/dsl_prop.c
+++ b/module/zfs/dsl_prop.c
@@ -1127,6 +1127,10 @@ dsl_prop_get_all_ds(dsl_dataset_t *ds, nvlist_t **nvp,
break;
}
out:
+ if (err) {
+ nvlist_free(*nvp);
+ *nvp = NULL;
+ }
return (err);
}
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
index e3166a40e..0a8d260e6 100644
--- a/module/zfs/zfs_ioctl.c
+++ b/module/zfs/zfs_ioctl.c
@@ -2033,8 +2033,10 @@ zfs_ioc_objset_stats_impl(zfs_cmd_t *zc, objset_t *os)
if (!zc->zc_objset_stats.dds_inconsistent &&
dmu_objset_type(os) == DMU_OST_ZVOL) {
error = zvol_get_stats(os, nv);
- if (error == EIO)
+ if (error == EIO) {
+ nvlist_free(nv);
return (error);
+ }
VERIFY0(error);
}
if (error == 0)