From: Jeremy Allison Date: Thu, 27 Sep 2018 21:12:47 +0000 (-0700) Subject: s3: smbd: Prevent valgrind errors in smbtorture3 POSIX test. X-Git-Tag: tdb-1.3.17~1476 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=660dbfaeff493359474ebdb36098ac49b3f7ba0c;p=thirdparty%2Fsamba.git s3: smbd: Prevent valgrind errors in smbtorture3 POSIX test. Missing fsp talloc free and linked list delete in error paths in close_directory(). Now matches close_normal_file() and close_fake_file(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13633 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sat Sep 29 05:32:41 CEST 2018 on sn-devel-144 --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 742b3f08715..f2f0a43181e 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1124,6 +1124,8 @@ 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))); + close_filestruct(fsp); + file_free(req, fsp); return NT_STATUS_INVALID_PARAMETER; } @@ -1183,6 +1185,8 @@ 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))); + close_filestruct(fsp); + file_free(req, fsp); return status; } }