From: Volker Lendecke Date: Sun, 10 Jan 2021 17:31:17 +0000 (+0100) Subject: rpc_client: Fix an error path memleak in rpc_pipe_open_ncalrpc() X-Git-Tag: samba-4.14.0rc1~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2745f6ec743df4c8ae98d59335bf64d6520d5aa5;p=thirdparty%2Fsamba.git rpc_client: Fix an error path memleak in rpc_pipe_open_ncalrpc() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 5a3ce69aaae..c14e95ac87e 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -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);