]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tools: Fix CID 1364704 - resource leak
authorAmitay Isaacs <amitay@gmail.com>
Thu, 4 Aug 2016 05:51:39 +0000 (15:51 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 8 Aug 2016 06:17:33 +0000 (08:17 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/tools/ctdb.c

index 4e767ae0fd376f3cac26de25797205ce0b8134fb..dd791148606db41c11edf0253e1d0e3c422520ec 100644 (file)
@@ -5737,6 +5737,7 @@ static int control_checktcpport(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
        v = fcntl(s, F_GETFL, 0);
        if (v == -1 || fcntl(s, F_SETFL, v | O_NONBLOCK)) {
                fprintf(stderr, "Unable to set socket non-blocking\n");
+               close(s);
                return errno;
        }