From: Günther Deschner Date: Wed, 11 Jun 2008 08:44:47 +0000 (+0200) Subject: rpc_client: fix some valgrind warnings. X-Git-Tag: samba-4.0.0alpha6~801^2~1083 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95a1f88d930808a7f1e63f47d78f349b4967b8a4;p=thirdparty%2Fsamba.git rpc_client: fix some valgrind warnings. Guenther (This used to be commit 0352682a355b42ced7628a720a6889d8453e7946) --- diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 8ba79d3c6d6..ba6fbddf7f6 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2522,7 +2522,7 @@ static NTSTATUS rpc_pipe_open_tcp_port(TALLOC_CTX *mem_ctx, const char *host, struct sockaddr_storage addr; NTSTATUS status; - result = talloc(mem_ctx, struct rpc_pipe_client); + result = TALLOC_ZERO_P(mem_ctx, struct rpc_pipe_client); if (result == NULL) { return NT_STATUS_NO_MEMORY; } @@ -2705,6 +2705,8 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host, NTSTATUS status; uint16_t port = 0; + *presult = NULL; + status = rpc_pipe_get_tcp_port(host, abstract_syntax, &port); if (!NT_STATUS_IS_OK(status)) { goto done; @@ -2877,7 +2879,7 @@ static struct rpc_pipe_client *cli_rpc_pipe_open(struct cli_state *cli, int pipe_idx, NTSTATUS *perr) { - struct rpc_pipe_client *result; + struct rpc_pipe_client *result = NULL; *perr = NT_STATUS_PIPE_NOT_AVAILABLE;