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:
parent
a44e58a31e
commit
74fb61d496
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user