1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

s3:winbindd_cm: close sockfd on error in cm_prepare_connection()

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Nov 21 19:58:58 CET 2011 on sn-devel-104
This commit is contained in:
Stefan Metzmacher 2011-11-21 18:03:44 +01:00
parent b895f1fb01
commit aa2e415442

View File

@ -802,6 +802,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
mutex = grab_named_mutex(talloc_tos(), controller,
WINBIND_SERVER_MUTEX_WAIT_TIME);
if (mutex == NULL) {
close(sockfd);
DEBUG(0,("cm_prepare_connection: mutex grab failed for %s\n",
controller));
result = NT_STATUS_POSSIBLE_DEADLOCK;
@ -814,6 +815,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
controller, domain->alt_name,
SMB_SIGNING_DEFAULT, flags);
if (*cli == NULL) {
close(sockfd);
DEBUG(1, ("Could not cli_initialize\n"));
result = NT_STATUS_NO_MEMORY;
goto done;