From: Ralph Boehme Date: Thu, 21 Jan 2021 13:36:59 +0000 (+0100) Subject: vfs_fruit: fix use after free in delete_invalid_meta_stream() X-Git-Tag: tevent-0.11.0~1924 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffd6bcdf37c2965a0405d4826dab29c9ca88ffc2;p=thirdparty%2Fsamba.git vfs_fruit: fix use after free in delete_invalid_meta_stream() sname is used in the DBG_ERR message. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 9250baee1b6..7c7c3cd036f 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -3491,12 +3491,13 @@ static NTSTATUS delete_invalid_meta_stream( handle->conn->cwd_fsp, sname, 0); - TALLOC_FREE(sname); if (ret != 0) { DBG_ERR("Removing [%s] failed\n", smb_fname_str_dbg(sname)); + TALLOC_FREE(sname); return map_nt_error_from_unix(errno); } + TALLOC_FREE(sname); return NT_STATUS_OK; }