]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In create_conn_struct_cwd(), don't TALLOC_FREE() an unallocated pointer...
authorJeremy Allison <jra@samba.org>
Tue, 24 Aug 2021 00:42:40 +0000 (17:42 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 25 Aug 2021 17:09:23 +0000 (17:09 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Aug 25 17:09:23 UTC 2021 on sn-devel-184

source3/smbd/msdfs.c

index 45b6478985d4781a6d28e99ebb091815d96cae2c..995ed815d908850148540e80ee33e48d95b8e027 100644 (file)
@@ -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)