From 5d1a32a542125e5ed10ef97112a07da242357917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 10 May 2021 10:56:53 +0200 Subject: [PATCH] linux/libshare: smb: don't leak share name in smb_disable_share_one() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 645fb9cc21 "Implemented sharing datasets via SMB using libshare" Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #12015 --- lib/libshare/os/linux/smb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libshare/os/linux/smb.c b/lib/libshare/os/linux/smb.c index 45811ff268..9b18848e09 100644 --- a/lib/libshare/os/linux/smb.c +++ b/lib/libshare/os/linux/smb.c @@ -308,7 +308,7 @@ smb_disable_share_one(const char *sharename) argv[2] = NET_CMD_ARG_HOST; argv[3] = (char *)"usershare"; argv[4] = (char *)"delete"; - argv[5] = strdup(sharename); + argv[5] = (char *)sharename; argv[6] = NULL; rc = libzfs_run_process(argv[0], argv, 0);