summaryrefslogtreecommitdiff
path: root/source3/libmsrpc
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/libmsrpc
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/libmsrpc')
-rw-r--r--source3/libmsrpc/libmsrpc_internal.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source3/libmsrpc/libmsrpc_internal.c b/source3/libmsrpc/libmsrpc_internal.c
index a86cde178d..64e6332e80 100644
--- a/source3/libmsrpc/libmsrpc_internal.c
+++ b/source3/libmsrpc/libmsrpc_internal.c
@@ -264,13 +264,16 @@ REG_VALUE_DATA *cac_MakeRegValueData( TALLOC_CTX * mem_ctx, uint32 data_type,
data->reg_binary.data_length = size;
- data->reg_binary.data =
- ( uint8 * ) TALLOC_MEMDUP( mem_ctx, buf.buffer,
- size );
- if ( !data->reg_binary.data ) {
- TALLOC_FREE( data );
- errno = ENOMEM;
- data = NULL;
+ if (size) {
+ data->reg_binary.data =
+ ( uint8 * ) TALLOC_MEMDUP( mem_ctx, buf.buffer, size );
+ if ( !data->reg_binary.data ) {
+ TALLOC_FREE( data );
+ errno = ENOMEM;
+ data = NULL;
+ }
+ } else {
+ data->reg_binary.data = NULL;
}
break;