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

s3-lib: Don't close the listener twice if we goto failed.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
This commit is contained in:
Andreas Schneider 2012-12-06 11:11:15 +01:00 committed by Günther Deschner
parent a44e58a31e
commit 74fb61d496

View File

@ -68,11 +68,11 @@ static int socketpair_tcp(int fd[2])
if ((fd[0] = accept(listener, (struct sockaddr *)&sock, &socklen)) == -1) goto failed;
close(listener);
if (connect_done == 0) {
if (connect(fd[1], (struct sockaddr *)&sock, socklen) != 0
&& errno != EISCONN) goto failed;
}
close(listener);
set_blocking(fd[1], 1);