From 74fb61d496348391a324fc69bb7b167597939d5b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Dec 2012 11:11:15 +0100 Subject: [PATCH] s3-lib: Don't close the listener twice if we goto failed. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner --- source3/lib/sock_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/sock_exec.c b/source3/lib/sock_exec.c index 403b38b1880..3d2ace9e360 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); -- 2.11.4.GIT