From: Volker Lendecke Date: Wed, 26 Sep 2012 20:20:57 +0000 (+0200) Subject: s3: Close the now opened file descriptor in error paths X-Git-Tag: talloc-2.0.8~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b7e75b3582f288774016ab3d5d32911959da5aa;p=thirdparty%2Fsamba.git s3: Close the now opened file descriptor in error paths --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 8fe87d5a511..b4eeeca5955 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2348,6 +2348,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, if (NT_STATUS_EQUAL(status, NT_STATUS_DELETE_PENDING)) { /* DELETE_PENDING is not deferred for a second */ TALLOC_FREE(lck); + fd_close(fsp); return status; } @@ -2366,6 +2367,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, DEBUG(0, ("DOS open without an SMB " "request!\n")); TALLOC_FREE(lck); + fd_close(fsp); return NT_STATUS_INTERNAL_ERROR; } @@ -2463,6 +2465,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, } TALLOC_FREE(lck); + fd_close(fsp); if (can_access) { /* * We have detected a sharing violation here