summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-06 11:11:15 +0100
committerGünther Deschner <gd@samba.org>2012-12-12 23:14:44 +0100
commit74fb61d496348391a324fc69bb7b167597939d5b (patch)
treeb6cb88888835776ce11468bca17128e07f5ff0a1
parenta44e58a31ebecd6f467ffdac6645ffe6a313e9c6 (diff)
downloadsamba-74fb61d496348391a324fc69bb7b167597939d5b.tar.gz
samba-74fb61d496348391a324fc69bb7b167597939d5b.tar.bz2
samba-74fb61d496348391a324fc69bb7b167597939d5b.zip
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>
-rw-r--r--source3/lib/sock_exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/sock_exec.c b/source3/lib/sock_exec.c
index 403b38b188..3d2ace9e36 100644
--- a/source3/lib/sock_exec.c
+++ b/source3/lib/sock_exec.c
@@ -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);