mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
Memory leak in make_root_vdev()
The newroot nvlist should be freed before returning. Signed-off-by: Isaac Huang <he.huang@intel.com> Signed-off-by: Chunwei Chen <tuxoko@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3264
This commit is contained in:
parent
ec8501ee12
commit
c5656c4cfc
@ -1699,8 +1699,10 @@ make_root_vdev(zpool_handle_t *zhp, nvlist_t *props, int force, int check_rep,
|
|||||||
if ((newroot = construct_spec(props, argc, argv)) == NULL)
|
if ((newroot = construct_spec(props, argc, argv)) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
if (zhp && ((poolconfig = zpool_get_config(zhp, NULL)) == NULL))
|
if (zhp && ((poolconfig = zpool_get_config(zhp, NULL)) == NULL)) {
|
||||||
|
nvlist_free(newroot);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate each device to make sure that its not shared with another
|
* Validate each device to make sure that its not shared with another
|
||||||
|
Loading…
Reference in New Issue
Block a user