s3: smbd: open_internal_dirfsp() add missing file_free() in error path.
authorJeremy Allison <jra@samba.org>
Fri, 18 Mar 2022 19:00:15 +0000 (12:00 -0700)
committerJule Anger <janger@samba.org>
Mon, 11 Apr 2022 07:49:13 +0000 (07:49 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15022

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit ec2fb9d22842332992b8f667a8218f7aaa1be7c4)

source3/smbd/files.c

index 677b600d0a60617390c9d9f913dcc7a713aadd70..a1788c2b822f683aa1b8228bcf4e4c4571fd2dbf 100644 (file)
@@ -266,6 +266,7 @@ NTSTATUS open_internal_dirfsp(connection_struct *conn,
 
        ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
        if (ret != 0) {
+               file_free(NULL, fsp);
                return map_nt_error_from_unix(errno);
        }