summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-30 01:34:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:48 -0500
commit79de0ad9463a5cd64978beae37df79fbb4f74632 (patch)
treefeb1638b81ac49909465456163e70cf4e57dc3a9 /source3/rpcclient
parent1e362c0e7fff603cffa32863a5b07ecbc50f8a2d (diff)
downloadsamba-79de0ad9463a5cd64978beae37df79fbb4f74632.tar.gz
samba-79de0ad9463a5cd64978beae37df79fbb4f74632.tar.bz2
samba-79de0ad9463a5cd64978beae37df79fbb4f74632.zip
r22588: Make all uses of TALLOC_MEMDUP consistent.
Jeremy. (This used to be commit 8ad13718af0ba1fcb10a6f1631b1ed3cb8d11175)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index e8561ea182..a16c7ea520 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -2027,15 +2027,23 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
UNISTR2 data;
init_unistr2(&data, argv[4], UNI_STR_TERMINATE);
value.size = data.uni_str_len * 2;
- value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, data.buffer,
+ if (value.size) {
+ value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, data.buffer,
value.size);
+ } else {
+ value.data_p = NULL;
+ }
break;
}
case REG_DWORD: {
uint32 data = strtoul(argv[4], NULL, 10);
value.size = sizeof(data);
- value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, &data,
+ if (sizeof(data)) {
+ value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, &data,
sizeof(data));
+ } else {
+ value.data_p = NULL;
+ }
break;
}
case REG_BINARY: {