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/libbe/common/be_create.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/libbe/common/be_create.c')
-rw-r--r-- | usr/src/lib/libbe/common/be_create.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/usr/src/lib/libbe/common/be_create.c b/usr/src/lib/libbe/common/be_create.c index f6a343829b..d06c9b02da 100644 --- a/usr/src/lib/libbe/common/be_create.c +++ b/usr/src/lib/libbe/common/be_create.c @@ -352,8 +352,7 @@ be_init(nvlist_t *be_attrs) } done: - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); be_zfs_fini(); @@ -1167,8 +1166,7 @@ done: ZFS_CLOSE(zhp); be_free_fs_list(&fld); - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); free(bt.obe_altroot); free(new_mp); @@ -2090,8 +2088,7 @@ be_copy_zones(char *obe_name, char *obe_root_ds, char *nbe_root_ds) "failed to create zone BE clone for new " "zone BE %s\n"), new_zone_be_name); ret = iret; - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); goto done; } /* @@ -2116,8 +2113,7 @@ be_copy_zones(char *obe_name, char *obe_root_ds, char *nbe_root_ds) "failed to generate auto name " "for zone BE.\n")); ret = BE_ERR_AUTONAME; - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); goto done; } @@ -2140,8 +2136,7 @@ be_copy_zones(char *obe_name, char *obe_root_ds, char *nbe_root_ds) zoneroot_ds, libzfs_error_description(g_zfs)); ret = zfs_err_to_be_err(g_zfs); - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); goto done; } @@ -2161,8 +2156,7 @@ be_copy_zones(char *obe_name, char *obe_root_ds, char *nbe_root_ds) "for new zone BE %s\n"), new_zone_be_name); ret = iret; - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); goto done; } } @@ -2177,14 +2171,12 @@ be_copy_zones(char *obe_name, char *obe_root_ds, char *nbe_root_ds) free(bt.nbe_name); bt.nbe_name = NULL; ret = BE_ERR_AUTONAME; - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); goto done; } } - if (bt.nbe_zfs_props != NULL) - nvlist_free(bt.nbe_zfs_props); + nvlist_free(bt.nbe_zfs_props); z_zhp = NULL; |