1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

smbd: Move the call to file_free() out of close_fake_file()

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>
This commit is contained in:
Volker Lendecke 2022-02-01 17:19:54 +01:00 committed by Jeremy Allison
parent 2293ca5b57
commit 244c5a7d31
2 changed files with 4 additions and 1 deletions

View 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);

View 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;
}