diff options
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> | 2016-02-24 11:58:55 -0500 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2016-02-27 08:52:10 -0800 |
commit | aab83bb83be7342f6cfccaed8d5fe0b2f404855d (patch) | |
tree | 548e8760643ee94860fb29486fbf965675c52a59 /usr/src/lib/libzfs/common/libzfs_pool.c | |
parent | d643a855cbd8c4fb4fe966406fa05dff70673597 (diff) | |
download | illumos-gate-aab83bb83be7342f6cfccaed8d5fe0b2f404855d.tar.gz |
6659 nvlist_free(NULL) is a no-op
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/lib/libzfs/common/libzfs_pool.c')
-rw-r--r-- | usr/src/lib/libzfs/common/libzfs_pool.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_pool.c b/usr/src/lib/libzfs/common/libzfs_pool.c index 3c99295179..1f3ab8c3e9 100644 --- a/usr/src/lib/libzfs/common/libzfs_pool.c +++ b/usr/src/lib/libzfs/common/libzfs_pool.c @@ -1025,12 +1025,9 @@ zpool_open(libzfs_handle_t *hdl, const char *pool) void zpool_close(zpool_handle_t *zhp) { - if (zhp->zpool_config) - nvlist_free(zhp->zpool_config); - if (zhp->zpool_old_config) - nvlist_free(zhp->zpool_old_config); - if (zhp->zpool_props) - nvlist_free(zhp->zpool_props); + nvlist_free(zhp->zpool_config); + nvlist_free(zhp->zpool_old_config); + nvlist_free(zhp->zpool_props); free(zhp); } @@ -1548,8 +1545,7 @@ zpool_import(libzfs_handle_t *hdl, nvlist_t *config, const char *newname, ret = zpool_import_props(hdl, config, newname, props, ZFS_IMPORT_NORMAL); - if (props) - nvlist_free(props); + nvlist_free(props); return (ret); } @@ -2854,8 +2850,7 @@ zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot, &children) != 0) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "Source pool is missing vdev tree")); - if (zc_props) - nvlist_free(zc_props); + nvlist_free(zc_props); return (-1); } @@ -3003,10 +2998,8 @@ out: free(varray); } zcmd_free_nvlists(&zc); - if (zc_props) - nvlist_free(zc_props); - if (newconfig) - nvlist_free(newconfig); + nvlist_free(zc_props); + nvlist_free(newconfig); if (freelist) { nvlist_free(*newroot); *newroot = NULL; |