From: Richard Yao Date: Sun, 16 Oct 2022 04:56:55 +0000 (-0400) Subject: set_global_var() should not pass NULL pointers to dlclose() X-Git-Tag: zfs-2.1.7~26 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=89c41f3979c11ee72c2129066acbbf2722036d2b;p=mirror_zfs.git set_global_var() should not pass NULL pointers to dlclose() Both Coverity and Clang's static analyzer caught this. Reviewed-by: Brian Behlendorf Signed-off-by: Richard Yao Closes #14044 --- diff --git a/lib/libzpool/util.c b/lib/libzpool/util.c index 327391245..f4e33140b 100644 --- a/lib/libzpool/util.c +++ b/lib/libzpool/util.c @@ -228,13 +228,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);