]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_client: fix some valgrind warnings.
authorGünther Deschner <gd@samba.org>
Wed, 11 Jun 2008 08:44:47 +0000 (10:44 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 11 Jun 2008 08:47:21 +0000 (10:47 +0200)
Guenther

source/rpc_client/cli_pipe.c

index 8ba79d3c6d6497739b3f99087122444c69ead761..ba6fbddf7f6269b6ba976cc6a5907c817ec446a3 100644 (file)
@@ -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;