s3:libsmb: close fd on error in cli_connect_nb()
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Nov 2011 17:03:07 +0000 (18:03 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 21 Nov 2011 17:03:07 +0000 (18:03 +0100)
metze

source3/libsmb/cliconnect.c

index a2a65b5b5c17227f29ef8d0c6d46ae1b976adff7..c2fa9239efe6620606ddbff34613e929140c8250 100644 (file)
@@ -3060,6 +3060,8 @@ NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss
 
        cli = cli_state_create(NULL, fd, desthost, NULL, signing_state, flags);
        if (cli == NULL) {
+               close(fd);
+               fd = -1;
                goto fail;
        }