aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzutil
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libzutil')
-rw-r--r--lib/libzutil/zutil_import.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c
index b8cdc118b..3a1827294 100644
--- a/lib/libzutil/zutil_import.c
+++ b/lib/libzutil/zutil_import.c
@@ -1539,7 +1539,7 @@ zpool_find_config(void *hdl, const char *target, nvlist_t **configp,
nvlist_t *pools;
nvlist_t *match = NULL;
nvlist_t *config = NULL;
- char *name = NULL, *sepp = NULL;
+ char *sepp = NULL;
char sep = '\0';
int count = 0;
char *targetdup = strdup(target);
@@ -1563,11 +1563,11 @@ zpool_find_config(void *hdl, const char *target, nvlist_t **configp,
/* multiple matches found */
continue;
} else {
- match = config;
- name = nvpair_name(elem);
+ match = fnvlist_dup(config);
}
}
}
+ fnvlist_free(pools);
}
if (count == 0) {
@@ -1577,6 +1577,7 @@ zpool_find_config(void *hdl, const char *target, nvlist_t **configp,
if (count > 1) {
free(targetdup);
+ fnvlist_free(match);
return (EINVAL);
}