]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_client: Fix an error path memleak in rpc_pipe_open_ncalrpc()
authorVolker Lendecke <vl@samba.org>
Sun, 10 Jan 2021 17:31:17 +0000 (18:31 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Jan 2021 00:10:30 +0000 (00:10 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_client/cli_pipe.c

index 5a3ce69aaae4e84bf018a327ae339857c428b15f..c14e95ac87e67b8b86018f70fb7f1e2d8170aabf 100644 (file)
@@ -2965,8 +2965,9 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
        if (connect(fd, (struct sockaddr *)(void *)&addr, salen) == -1) {
                DEBUG(0, ("connect(%s) failed: %s\n", socket_path,
                          strerror(errno)));
+               status = map_nt_error_from_unix(errno);
                close(fd);
-               return map_nt_error_from_unix(errno);
+               goto fail;
        }
 
        status = rpc_transport_sock_init(result, fd, &result->transport);