summaryrefslogtreecommitdiffstats
path: root/source/rpc_parse
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
commit8ad13718af0ba1fcb10a6f1631b1ed3cb8d11175 (patch)
tree9436cacf45161fb2b80b2d088d17f921aae62a03 /source/rpc_parse
parentc3df5d08dd6a983f9d53dc6628a50e571d322e8d (diff)
downloadsamba-8ad13718af0ba1fcb10a6f1631b1ed3cb8d11175.tar.gz
samba-8ad13718af0ba1fcb10a6f1631b1ed3cb8d11175.tar.xz
samba-8ad13718af0ba1fcb10a6f1631b1ed3cb8d11175.zip
r22588: Make all uses of TALLOC_MEMDUP consistent.
Jeremy.
Diffstat (limited to 'source/rpc_parse')
-rw-r--r--source/rpc_parse/parse_spoolss.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c
index 9c180d34739..98280ee8444 100644
--- a/source/rpc_parse/parse_spoolss.c
+++ b/source/rpc_parse/parse_spoolss.c
@@ -5251,9 +5251,13 @@ BOOL make_spoolss_buffer5(TALLOC_CTX *mem_ctx, BUFFER5 *buf5, uint32 len, uint16
buf5->buf_len = len;
if (src) {
- if((buf5->buffer=(uint16*)TALLOC_MEMDUP(mem_ctx, src, sizeof(uint16)*len)) == NULL) {
- DEBUG(0,("make_spoolss_buffer5: Unable to malloc memory for buffer!\n"));
- return False;
+ if (len) {
+ if((buf5->buffer=(uint16*)TALLOC_MEMDUP(mem_ctx, src, sizeof(uint16)*len)) == NULL) {
+ DEBUG(0,("make_spoolss_buffer5: Unable to malloc memory for buffer!\n"));
+ return False;
+ }
+ } else {
+ buf5->buffer = NULL;
}
} else {
buf5->buffer=NULL;