s3-rpc_client: Fix some valgrind warnings.
authorAndreas Schneider <asn@samba.org>
Mon, 20 Jun 2011 13:39:36 +0000 (15:39 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 21 Jun 2011 15:46:37 +0000 (17:46 +0200)
These are in/out values and need to be initialized.

Signed-off-by: Günther Deschner <gd@samba.org>
source3/rpc_client/cli_winreg.c

index 3731fc7e799ef1e59ae16737a68ebd4321783c95..e5ebc25ed80f7190558ebf42bd91c1dbbe166e6d 100644 (file)
@@ -33,7 +33,7 @@ NTSTATUS dcerpc_winreg_query_dword(TALLOC_CTX *mem_ctx,
                                   WERROR *pwerr)
 {
        struct winreg_String wvalue;
-       enum winreg_Type type;
+       enum winreg_Type type = REG_NONE;
        uint32_t value_len = 0;
        uint32_t data_size = 0;
        WERROR result = WERR_OK;
@@ -69,7 +69,7 @@ NTSTATUS dcerpc_winreg_query_dword(TALLOC_CTX *mem_ctx,
                return status;
        }
 
-       blob = data_blob_talloc(mem_ctx, NULL, data_size);
+       blob = data_blob_talloc_zero(mem_ctx, data_size);
        if (blob.data == NULL) {
                *pwerr = WERR_NOMEM;
                return status;
@@ -108,13 +108,14 @@ NTSTATUS dcerpc_winreg_query_binary(TALLOC_CTX *mem_ctx,
                                    WERROR *pwerr)
 {
        struct winreg_String wvalue;
-       enum winreg_Type type;
+       enum winreg_Type type = REG_NONE;
        WERROR result = WERR_OK;
        uint32_t value_len = 0;
        uint32_t data_size = 0;
        NTSTATUS status;
        DATA_BLOB blob;
 
+       ZERO_STRUCT(wvalue);
        wvalue.name = value;
 
        status = dcerpc_winreg_QueryValue(h,
@@ -139,7 +140,7 @@ NTSTATUS dcerpc_winreg_query_binary(TALLOC_CTX *mem_ctx,
                return status;
        }
 
-       blob = data_blob_talloc(mem_ctx, NULL, data_size);
+       blob = data_blob_talloc_zero(mem_ctx, data_size);
        if (blob.data == NULL) {
                *pwerr = WERR_NOMEM;
                return status;
@@ -179,7 +180,7 @@ NTSTATUS dcerpc_winreg_query_multi_sz(TALLOC_CTX *mem_ctx,
                                      WERROR *pwerr)
 {
        struct winreg_String wvalue;
-       enum winreg_Type type;
+       enum winreg_Type type = REG_NONE;
        WERROR result = WERR_OK;
        uint32_t value_len = 0;
        uint32_t data_size = 0;
@@ -210,7 +211,7 @@ NTSTATUS dcerpc_winreg_query_multi_sz(TALLOC_CTX *mem_ctx,
                return status;
        }
 
-       blob = data_blob_talloc(mem_ctx, NULL, data_size);
+       blob = data_blob_talloc_zero(mem_ctx, data_size);
        if (blob.data == NULL) {
                *pwerr = WERR_NOMEM;
                return status;
@@ -254,7 +255,7 @@ NTSTATUS dcerpc_winreg_query_sz(TALLOC_CTX *mem_ctx,
                                      WERROR *pwerr)
 {
        struct winreg_String wvalue;
-       enum winreg_Type type;
+       enum winreg_Type type = REG_NONE;
        WERROR result = WERR_OK;
        uint32_t value_len = 0;
        uint32_t data_size = 0;
@@ -285,7 +286,7 @@ NTSTATUS dcerpc_winreg_query_sz(TALLOC_CTX *mem_ctx,
                return status;
        }
 
-       blob = data_blob_talloc(mem_ctx, NULL, data_size);
+       blob = data_blob_talloc_zero(mem_ctx, data_size);
        if (blob.data == NULL) {
                *pwerr = WERR_NOMEM;
                return status;
@@ -380,13 +381,14 @@ NTSTATUS dcerpc_winreg_set_dword(TALLOC_CTX *mem_ctx,
                                 uint32_t data,
                                 WERROR *pwerr)
 {
-       struct winreg_String wvalue = { 0, };
+       struct winreg_String wvalue;
        DATA_BLOB blob;
        WERROR result = WERR_OK;
        NTSTATUS status;
 
+       ZERO_STRUCT(wvalue);
        wvalue.name = value;
-       blob = data_blob_talloc(mem_ctx, NULL, 4);
+       blob = data_blob_talloc_zero(mem_ctx, 4);
        SIVAL(blob.data, 0, data);
 
        status = dcerpc_winreg_SetValue(h,