summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-01-19 15:09:51 -0800
committerSteven Danneman <steven.danneman@isilon.com>2009-01-21 17:13:03 -0800
commit989ad44d32c2e77972a966d91f1813b0b929f83b (patch)
treebb7a41c961fe974f464f7ce2a27ca3bf055187bf /source3/rpc_parse
parente9615b43b4dc7037da7bc274d720b8e54c7f85bc (diff)
downloadsamba-989ad44d32c2e77972a966d91f1813b0b929f83b.tar.gz
samba-989ad44d32c2e77972a966d91f1813b0b929f83b.tar.bz2
samba-989ad44d32c2e77972a966d91f1813b0b929f83b.zip
Memory leaks and other fixes found by Coverity
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_buffer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c
index b5177cc634..99546ef3fb 100644
--- a/source3/rpc_parse/parse_buffer.c
+++ b/source3/rpc_parse/parse_buffer.c
@@ -30,14 +30,15 @@
/**********************************************************************
Initialize a new spoolss buff for use by a client rpc
**********************************************************************/
-void rpcbuf_init(RPC_BUFFER *buffer, uint32 size, TALLOC_CTX *ctx)
+bool rpcbuf_init(RPC_BUFFER *buffer, uint32 size, TALLOC_CTX *ctx)
{
buffer->size = size;
buffer->string_at_end = size;
- if (prs_init(&buffer->prs, size, ctx, MARSHALL))
- buffer->struct_start = prs_offset(&buffer->prs);
- else
- buffer->struct_start = 0;
+ if (!prs_init(&buffer->prs, size, ctx, MARSHALL))
+ return false;
+
+ buffer->struct_start = prs_offset(&buffer->prs);
+ return true;
}
/*******************************************************************