summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_samr.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-06-04 06:22:44 +0000
committerJeremy Allison <jra@samba.org>2003-06-04 06:22:44 +0000
commitbcf59e2575a486629a52f9d2e7cb29260595686f (patch)
tree3eaaf82746c7b52d3c9b420d30b00237e58b3d05 /source3/rpc_parse/parse_samr.c
parentb6cb0e914d10524721d51fb01fcd84d476f30157 (diff)
downloadsamba-bcf59e2575a486629a52f9d2e7cb29260595686f.tar.gz
samba-bcf59e2575a486629a52f9d2e7cb29260595686f.tar.bz2
samba-bcf59e2575a486629a52f9d2e7cb29260595686f.zip
Fix for previous checkin. Only use talloc on unmarshalling or we'll
leak memory. Jeremy. (This used to be commit 07a76eb2e01833d5e2e447391cffeda712118c20)
Diffstat (limited to 'source3/rpc_parse/parse_samr.c')
-rw-r--r--source3/rpc_parse/parse_samr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index 643b35e2e7..2146ccec91 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -4619,9 +4619,11 @@ BOOL samr_io_r_query_aliasmem(const char *desc, SAMR_R_QUERY_ALIASMEM * r_u,
if(!prs_uint32("num_sids1", ps, depth, &r_u->num_sids1))
return False;
- ptr_sid = talloc(ps->mem_ctx, sizeof(uint32) * r_u->num_sids1);
- if (!ptr_sid) {
- return False;
+ if (UNMARSHALLING(ps)) {
+ ptr_sid = talloc(ps->mem_ctx, sizeof(uint32) * r_u->num_sids1);
+ if (!ptr_sid) {
+ return False;
+ }
}
for (i = 0; i < r_u->num_sids1; i++) {