diff options
author | Volker Lendecke <vl@samba.org> | 2022-02-01 17:14:34 +0100 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-02-14 17:46:14 +0000 |
commit | 692fb63a1ace5d4f2f03445458514fcff1e927a8 (patch) | |
tree | 22be3358dcaca6343212ccdc7c23c499a0957148 | |
parent | a260463481a90812c483195273d7001269570080 (diff) | |
download | samba-692fb63a1ace5d4f2f03445458514fcff1e927a8.tar.gz |
smbd: Move the call to file_free() out of close_directory()
Call file_free() just once
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14975
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9966b5e233ef2ff0368ba5860c824c7cd6420415)
-rw-r--r-- | source3/smbd/close.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 8abd3fb3861..cd406f08bee 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1379,7 +1379,6 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, if (lck == NULL) { DEBUG(0, ("close_directory: Could not get share mode lock for " "%s\n", fsp_str_dbg(fsp))); - file_free(req, fsp); return NT_STATUS_INVALID_PARAMETER; } @@ -1429,7 +1428,6 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, if (!NT_STATUS_IS_OK(status)) { DEBUG(5, ("delete_all_streams failed: %s\n", nt_errstr(status))); - file_free(req, fsp); /* unbecome user. */ pop_sec_ctx(); return status; @@ -1472,11 +1470,6 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, strerror(errno))); } - /* - * Do the code common to files and directories. - */ - file_free(req, fsp); - if (NT_STATUS_IS_OK(status) && !NT_STATUS_IS_OK(status1)) { status = status1; } @@ -1562,6 +1555,7 @@ NTSTATUS close_file(struct smb_request *req, files_struct *fsp, status = NT_STATUS_OK; } else if (fsp->fsp_flags.is_directory) { status = close_directory(req, fsp, close_type); + file_free(req, fsp); } else { status = close_normal_file(req, fsp, close_type); } |