diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/rpc_client/cli_winreg.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/rpc_client/cli_winreg.c')
-rw-r--r-- | source3/rpc_client/cli_winreg.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source3/rpc_client/cli_winreg.c b/source3/rpc_client/cli_winreg.c index 2517dbc50a..e5ebc25ed8 100644 --- a/source3/rpc_client/cli_winreg.c +++ b/source3/rpc_client/cli_winreg.c @@ -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, @@ -615,7 +617,7 @@ NTSTATUS dcerpc_winreg_add_multi_sz(TALLOC_CTX *mem_ctx, /* count the elements */ for (p = a, i = 0; p && *p; p++, i++); - p = TALLOC_REALLOC_ARRAY(mem_ctx, a, const char *, i + 2); + p = talloc_realloc(mem_ctx, a, const char *, i + 2); if (p == NULL) { *pwerr = WERR_NOMEM; return NT_STATUS_OK; |