Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: liuhuang <liu.huang@zte.com.cn>
Closes #5085
/*
* Allow hot spares to be shared between pools.
*/
- if (state == POOL_STATE_SPARE && isspare)
+ if (state == POOL_STATE_SPARE && isspare) {
+ free(name);
+ (void) close(fd);
return (0);
+ }
if (state == POOL_STATE_ACTIVE ||
state == POOL_STATE_SPARE || !force) {
free(name);
(void) close(fd);
- if (config == NULL)
+ if (config == NULL) {
+ nvlist_free(label);
return (B_TRUE);
+ }
verify(nvlist_lookup_uint64(label, ZPOOL_CONFIG_GUID, &guid) == 0);
nvlist_free(label);