s3-spoolss: Fix some valgrind warnings.
authorAndreas Schneider <asn@samba.org>
Mon, 20 Jun 2011 17:27:01 +0000 (19:27 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 21 Jun 2011 16:58:29 +0000 (18:58 +0200)
These are in/out values and need to be initialized.

Signed-off-by: Günther Deschner <gd@samba.org>
Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Jun 21 18:58:30 CEST 2011 on sn-devel-104

source3/rpc_server/spoolss/srv_spoolss_nt.c
source3/rpc_server/spoolss/srv_spoolss_util.c

index cb311ef..8216388 100644 (file)
@@ -9191,9 +9191,9 @@ WERROR _spoolss_GetPrinterDataEx(struct pipes_struct *p,
        int                     snum = 0;
        WERROR result = WERR_OK;
        DATA_BLOB blob;
-       enum winreg_Type val_type;
-       uint8_t *val_data;
-       uint32_t val_size;
+       enum winreg_Type val_type = REG_NONE;
+       uint8_t *val_data = NULL;
+       uint32_t val_size = 0;
 
 
        DEBUG(4,("_spoolss_GetPrinterDataEx\n"));
index ecb3567..5201571 100644 (file)
@@ -471,7 +471,7 @@ static WERROR winreg_printer_enumvalues(TALLOC_CTX *mem_ctx,
                data_size = max_valbufsize;
                data = NULL;
                if (data_size) {
-                       data = (uint8_t *) TALLOC(tmp_ctx, data_size);
+                       data = (uint8_t *) talloc_zero_size(tmp_ctx, data_size);
                }
                length = 0;
 
@@ -2315,9 +2315,9 @@ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx,
        struct dcerpc_binding_handle *winreg_handle = NULL;
        struct policy_handle hive_hnd, key_hnd;
        struct winreg_String wvalue;
-       enum winreg_Type type_in;
+       enum winreg_Type type_in = REG_NONE;
        char *path;
-       uint8_t *data_in;
+       uint8_t *data_in = NULL;
        uint32_t data_in_size = 0;
        uint32_t value_len = 0;
        WERROR result = WERR_OK;
@@ -3337,8 +3337,8 @@ WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx,
        struct dcerpc_binding_handle *winreg_handle = NULL;
        struct policy_handle hive_hnd, key_hnd;
        struct winreg_String wvalue;
-       enum winreg_Type type_in;
-       uint8_t *data_in;
+       enum winreg_Type type_in = REG_NONE;
+       uint8_t *data_in = NULL;
        uint32_t data_in_size = 0;
        uint32_t value_len = 0;
        uint32_t num_builtin = ARRAY_SIZE(builtin_forms1);