smbd: Fix a fd leak when closing a print file
authorVolker Lendecke <vl@samba.org>
Tue, 28 Dec 2021 11:25:40 +0000 (12:25 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 30 Dec 2021 11:03:35 +0000 (11:03 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/close.c

index 0ea0f096fead6cba271df93e73178eae92dbed05..610450d086f67938b365a3756ad805d7d45a0df6 100644 (file)
@@ -1542,6 +1542,7 @@ NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
        } else if (fsp->print_file != NULL) {
                /* FIXME: return spool errors */
                print_spool_end(fsp, close_type);
+               fd_close(fsp);
                file_free(req, fsp);
                status = NT_STATUS_OK;
        } else if (!fsp->fsp_flags.is_fsa) {