]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Do an early talloc_free in an error path
authorVolker Lendecke <vl@samba.org>
Mon, 20 Jan 2025 14:52:06 +0000 (15:52 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 23 Jan 2025 23:08:38 +0000 (23:08 +0000)
Not a long-term memleak, talloc_tos() takes care of this later, but
this looks cleaner to me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c

index c726298ac6fee3ed9c813419cf362d67aa93b4ec..5d16cbb5bf32253d3750ed9c9ff38284e65ace07 100644 (file)
@@ -1406,6 +1406,7 @@ static NTSTATUS vfswrap_parent_pathname(struct vfs_handle_struct *handle,
                smb_fname_in->twrp,
                smb_fname_in->flags);
        if (name == NULL) {
+               TALLOC_FREE(parent);
                return NT_STATUS_NO_MEMORY;
        }