From: Volker Lendecke Date: Tue, 1 Feb 2022 16:19:54 +0000 (+0100) Subject: smbd: Move the call to file_free() out of close_fake_file() X-Git-Tag: tevent-0.12.0~753 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=244c5a7d31c3a37082b320680f2b71108d77bbd4;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index bbcdae45429..dd4a4c3595f 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -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); diff --git a/source3/smbd/fake_file.c b/source3/smbd/fake_file.c index 92ea14a76da..5d669bfe8e5 100644 --- a/source3/smbd/fake_file.c +++ b/source3/smbd/fake_file.c @@ -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; }