]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
net: Fix a panic in "net vfs getntacl"
authorVolker Lendecke <vl@samba.org>
Thu, 20 Mar 2025 16:57:11 +0000 (17:57 +0100)
committerMartin Schwenke <martins@samba.org>
Sat, 14 Jun 2025 08:46:34 +0000 (08:46 +0000)
We have to explicitly free smb_fname, because after openat_pathref_fsp
we have a file descriptor around. If we then later talloc_free() the
connection_struct, fd_handle_destructor() panics because talloc_free()
does not free smb_fname before the connection_struct.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/utils/net_vfs.c

index 1cc775f3c4d05c643017fd0ffe5be9247defea5c..8120811676e97ae0122f4653d52c3d65b9c3f54c 100644 (file)
@@ -278,6 +278,7 @@ static int net_vfs_get_ntacl(struct net_context *net,
        if (!NT_STATUS_IS_OK(status)) {
                DBG_ERR("SMB_VFS_CREATE_FILE [%s] failed: %s\n",
                        smb_fname_str_dbg(smb_fname), nt_errstr(status));
+               TALLOC_FREE(smb_fname);
                goto done;
        }