summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJosef 'Jeff' Sipek <[email protected]>2016-03-31 23:54:07 -0400
committerBrian Behlendorf <[email protected]>2016-04-27 15:58:23 -0700
commit8a5fc74880251aa651306d1dbcc60715698996f0 (patch)
treefd37b86a51274e2e6c3942d1adca2d088127c9ea /cmd
parent16794374b37fb22c32616fe1f40ade1304628ff9 (diff)
Illumos 6659 - nvlist_free(NULL) is a no-op
6659 nvlist_free(NULL) is a no-op Reviewed by: Toomas Soome <[email protected]> Reviewed by: Marcel Telka <[email protected]> Approved by: Robert Mustacchi <[email protected]> References: https://www.illumos.org/issues/6659 https://github.com/illumos/illumos-gate/commit/aab83bb Ported-by: David Quigley <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4566
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zfs/zfs_main.c3
-rw-r--r--cmd/zpool/zpool_main.c6
-rw-r--r--cmd/zpool/zpool_vdev.c3
3 files changed, 4 insertions, 8 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 579607451..7525afcbf 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -5294,8 +5294,7 @@ zfs_do_allow_unallow_impl(int argc, char **argv, boolean_t un)
cleanup0:
nvlist_free(perm_nvl);
- if (update_perm_nvl != NULL)
- nvlist_free(update_perm_nvl);
+ nvlist_free(update_perm_nvl);
cleanup1:
fs_perm_set_fini(&fs_perm_set);
cleanup2:
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index d6b9f4914..0c48805d1 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -3674,8 +3674,7 @@ zpool_do_split(int argc, char **argv)
if (add_prop_list(
zpool_prop_to_name(ZPOOL_PROP_ALTROOT), optarg,
&props, B_TRUE) != 0) {
- if (props)
- nvlist_free(props);
+ nvlist_free(props);
usage(B_FALSE);
}
break;
@@ -3688,8 +3687,7 @@ zpool_do_split(int argc, char **argv)
propval++;
if (add_prop_list(optarg, propval,
&props, B_TRUE) != 0) {
- if (props)
- nvlist_free(props);
+ nvlist_free(props);
usage(B_FALSE);
}
} else {
diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c
index cf87554d5..587aa7fd4 100644
--- a/cmd/zpool/zpool_vdev.c
+++ b/cmd/zpool/zpool_vdev.c
@@ -1675,8 +1675,7 @@ split_mirror_vdev(zpool_handle_t *zhp, char *newname, nvlist_t *props,
}
if (zpool_vdev_split(zhp, newname, &newroot, props, flags) != 0) {
- if (newroot != NULL)
- nvlist_free(newroot);
+ nvlist_free(newroot);
return (NULL);
}