diff --git a/lib/libzpool/util.c b/lib/libzpool/util.c index 0ce7822a3..a310255d7 100644 --- a/lib/libzpool/util.c +++ b/lib/libzpool/util.c @@ -229,13 +229,14 @@ set_global_var(char const *arg) fprintf(stderr, "Failed to open libzpool.so to set global " "variable\n"); ret = EIO; - goto out_dlclose; + goto out_free; } ret = 0; out_dlclose: dlclose(zpoolhdl); +out_free: free(varname); out_ret: return (ret);