From b358d3d7fef37c7c86c0a501ab6c0ff4b8b7b1c5 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Wed, 16 Jan 2013 15:02:26 +0400 Subject: [PATCH] s3:smbd: fix wrong lock order in posix unlink Signed-off-by: Pavel Shilovsky --- source3/smbd/trans2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 9b15698..893c6b2 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7662,12 +7662,14 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, continue; } /* Fail with sharing violation. */ - close_file(req, fsp, NORMAL_CLOSE); TALLOC_FREE(lck); + close_file(req, fsp, NORMAL_CLOSE); return NT_STATUS_SHARING_VIOLATION; } } + TALLOC_FREE(lck); + /* * Set the delete on close. */ @@ -7679,10 +7681,8 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, if (!NT_STATUS_IS_OK(status)) { close_file(req, fsp, NORMAL_CLOSE); - TALLOC_FREE(lck); return status; } - TALLOC_FREE(lck); return close_file(req, fsp, NORMAL_CLOSE); } -- 1.8.1.1