summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-20 15:39:36 +0200
committerKarolin Seeger <kseeger@samba.org>2011-07-26 21:50:23 +0200
commit1a548f747fd589220e0b718c91f84a24d5399da4 (patch)
tree4b5a5c04dc854bff79cb275dac87aabd975d53e0 /source3/rpc_client
parent6902bdb2423dd0f39477017180908b16b1914bd2 (diff)
downloadsamba-1a548f747fd589220e0b718c91f84a24d5399da4.tar.gz
s3-rpc_client: Fix some valgrind warnings.
These are in/out values and need to be initialized. (cherry picked from commit 7bf1418e9cfe313ee4873853d2ee41ca344f8ee0)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_winreg.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source3/rpc_client/cli_winreg.c b/source3/rpc_client/cli_winreg.c
index 2517dbc50ab..304d5b49e46 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,