diff --git a/lib/libzpool/util.c b/lib/libzpool/util.c index 20cabe7c2e..327391245a 100644 --- a/lib/libzpool/util.c +++ b/lib/libzpool/util.c @@ -173,12 +173,13 @@ set_global_var_parse_kv(const char *arg, char **k_out, u_longlong_t *v_out) goto err_free; } - *k_out = k; + *k_out = strdup(k); *v_out = val; + free(d); return (0); err_free: - free(k); + free(d); return (err); }