From: Jeremy Allison Date: Tue, 24 Aug 2021 00:42:40 +0000 (-0700) Subject: s3: smbd: In create_conn_struct_cwd(), don't TALLOC_FREE() an unallocated pointer... X-Git-Tag: ldb-2.5.0~843 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=857045f3a236dea125200dd09279d677e513682b;p=thirdparty%2Fsamba.git s3: smbd: In create_conn_struct_cwd(), don't TALLOC_FREE() an unallocated pointer on error. Just return the status - if create_conn_struct_as_root() fails the connection struct never gets returned. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14809 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Wed Aug 25 17:09:23 UTC 2021 on sn-devel-184 --- diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 45b6478985d..995ed815d90 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -525,12 +525,7 @@ NTSTATUS create_conn_struct_cwd(TALLOC_CTX *mem_ctx, path, session_info); unbecome_root(); - if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(c); - return status; - } - - return NT_STATUS_OK; + return status; } static void shuffle_strlist(char **list, int count)