summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-10-10 07:52:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:55 -0500
commitaf5e5175215145fb36bb28357894c41abd3bca84 (patch)
tree797f67c8f3281898afd5f4b69aa8e4aa4847ad18 /source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
parenta3a7c28765f100a28557ba30ec57bde030a6e363 (diff)
downloadsamba-af5e5175215145fb36bb28357894c41abd3bca84.tar.gz
samba-af5e5175215145fb36bb28357894c41abd3bca84.tar.bz2
samba-af5e5175215145fb36bb28357894c41abd3bca84.zip
r19219: Fix a memleak in the generated srv_code.
Fix a warning. Implement the rng_fault_state return check. After this (and Jeremy's fix) all Samba3-developers should do a 'make idl' and do a complete rebuild. Volker (This used to be commit 0c0a861c8b5b4c44d290f8db0d4c5e95260140ca)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
index 02fd1884a2..a7c81e4e2b 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
@@ -70,8 +70,10 @@ sub ParseFunction($$)
pidl "}";
pidl "";
pidl "pull = ndr_pull_init_blob(&blob, mem_ctx);";
- pidl "if (pull == NULL)";
+ pidl "if (pull == NULL) {";
+ pidl "\ttalloc_free(mem_ctx);";
pidl "\treturn False;";
+ pidl "}";
pidl "";
pidl "pull->flags |= LIBNDR_FLAG_REF_ALLOC;";
pidl "status = ndr_pull_$fn->{NAME}(pull, NDR_IN, &r);";
@@ -122,6 +124,12 @@ sub ParseFunction($$)
pidl "$ret;";
pidl "";
+ pidl "if (p->rng_fault_state) {";
+ pidl "\ttalloc_free(mem_ctx);";
+ pidl "\t/* Return True here, srv_pipe_hnd.c will take care */";
+ pidl "\treturn True;";
+ pidl "}";
+ pidl "";
pidl "if (DEBUGLEVEL >= 10)";
pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, &r);";
pidl "";
@@ -138,7 +146,7 @@ sub ParseFunction($$)
pidl "}";
pidl "";
pidl "blob = ndr_push_blob(push);";
- pidl "if (!prs_copy_data_in(&p->out_data.rdata, blob.data, (uint32)blob.length)) {";
+ pidl "if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {";
pidl "\ttalloc_free(mem_ctx);";
pidl "\treturn False;";
pidl "}";