]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move the call to file_free() out of close_fake_file()
authorVolker Lendecke <vl@samba.org>
Tue, 1 Feb 2022 16:19:54 +0000 (17:19 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 10 Feb 2022 18:16:36 +0000 (18:16 +0000)
Centralize calling file_free(), but leave close_fake_file() in for API
symmetry reasons.

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

index bbcdae454299eea4bd3c68acfb2b6dd6b648860c..dd4a4c3595fcf9eb7777faa30b29ea50d33184ec 100644 (file)
@@ -1532,6 +1532,7 @@ NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
 
        if (fsp->fake_file_handle != NULL) {
                status = close_fake_file(req, fsp);
+               file_free(req, fsp);
        } else if (fsp->print_file != NULL) {
                /* FIXME: return spool errors */
                print_spool_end(fsp, close_type);
index 92ea14a76daed94aa19b5d7715ddb81eefb3c6c2..5d669bfe8e57698aa0284e5c5cac2fbfd23c65af 100644 (file)
@@ -206,6 +206,8 @@ NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
 
 NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp)
 {
-       file_free(req, fsp);
+       /*
+        * Nothing to do, fake files don't hold any resources
+        */
        return NT_STATUS_OK;
 }