diff options
author | Jeremy Allison <jra@samba.org> | 2007-04-30 01:34:28 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-04-30 01:34:28 +0000 |
commit | f42f63fac09303f381018c34c126119f55f0fb57 (patch) | |
tree | b4c3a969bb89b0b30835479cb1f72f3975caf0fe /source/rpc_client | |
parent | 032cfcfa6e294ae146e40b82a39100d8f48c3283 (diff) | |
download | samba-f42f63fac09303f381018c34c126119f55f0fb57.tar.gz samba-f42f63fac09303f381018c34c126119f55f0fb57.tar.xz samba-f42f63fac09303f381018c34c126119f55f0fb57.zip |
r22588: Make all uses of TALLOC_MEMDUP consistent.
Jeremy.
Diffstat (limited to 'source/rpc_client')
-rw-r--r-- | source/rpc_client/cli_spoolss.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source/rpc_client/cli_spoolss.c b/source/rpc_client/cli_spoolss.c index 75c617c944c..2d40f5dba1a 100644 --- a/source/rpc_client/cli_spoolss.c +++ b/source/rpc_client/cli_spoolss.c @@ -1609,7 +1609,11 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *me /* Return output parameters */ - value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed); + if (out.needed) { + value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed); + } else { + value->data_p = NULL; + } value->type = out.type; value->size = out.size; @@ -1662,7 +1666,11 @@ WERROR rpccli_spoolss_getprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX * /* Return output parameters */ - value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed); + if (out.needed) { + value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed); + } else { + value->data_p = NULL; + } value->type = out.type; value->size = out.needed; @@ -1758,8 +1766,12 @@ WERROR rpccli_spoolss_enumprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *m if (value) { rpcstr_pull(value->valuename, out.value, sizeof(value->valuename), -1, STR_TERMINATE); - value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, + if (out.realdatasize) { + value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.realdatasize); + } else { + value->data_p = NULL; + } value->type = out.type; value->size = out.realdatasize; } |