diff options
-rw-r--r-- | source3/rpc_parse/parse_buffer.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c index a48d5cfa98..ff2a7cc2f6 100644 --- a/source3/rpc_parse/parse_buffer.c +++ b/source3/rpc_parse/parse_buffer.c @@ -173,14 +173,20 @@ BOOL rpcbuf_alloc_size(RPC_BUFFER *buffer, uint32 buffer_size) void rpcbuf_move(RPC_BUFFER *src, RPC_BUFFER **dest) { - SMB_ASSERT( src != NULL ); + if ( !src ) { + *dest = NULL; + return; + } + + prs_switch_type( &src->prs, MARSHALL ); - prs_switch_type(&src->prs, MARSHALL); - if(!prs_set_offset(&src->prs, 0)) + if ( !prs_set_offset(&src->prs, 0) ) return; - prs_force_dynamic(&src->prs); - prs_mem_clear(&src->prs); - *dest=src; + + prs_force_dynamic( &src->prs ); + prs_mem_clear( &src->prs ); + + *dest = src; } /******************************************************************* |