From: Ralph Boehme Date: Sat, 13 Jun 2020 14:21:22 +0000 (+0200) Subject: smbd: check for conn->cwd_fsp in file_free() X-Git-Tag: talloc-2.3.2~1071 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a929644b28c6dc71594c1000cfaeeb0fde094184;p=thirdparty%2Fsamba.git smbd: check for conn->cwd_fsp in file_free() This avoids doing the check in all callers. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 1a59db7d1e1..8bba6c550b3 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -591,6 +591,10 @@ void file_free(struct smb_request *req, files_struct *fsp) struct smbd_server_connection *sconn = fsp->conn->sconn; uint64_t fnum = fsp->fnum; + if (fsp == fsp->conn->cwd_fsp) { + return; + } + if (fsp->notify) { size_t len = fsp_fullbasepath(fsp, NULL, 0); char fullpath[len+1];