diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-09-10 11:07:48 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-01-07 08:37:35 +0100 |
commit | 70d8ac63ebd3cb1cf07e0bff85ae6040fba76147 (patch) | |
tree | 80277501c5cf0e688d53a0297c5097fa4c3807e7 /librpc | |
parent | 4cc3388c034fa43c855fba802a30bbd2e78122be (diff) | |
download | samba-70d8ac63ebd3cb1cf07e0bff85ae6040fba76147.tar.gz |
librpc/ndrdump: free some temporary memory while parsing dcerpc pipe chunks
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/tools/ndrdump.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c index 692e6559480..02cc47aaf9a 100644 --- a/librpc/tools/ndrdump.c +++ b/librpc/tools/ndrdump.c @@ -143,6 +143,7 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char *function, for (i=0; i < pipes->num_pipes; i++) { uint64_t idx = 0; while (true) { + void *saved_mem_ctx; uint32_t *count; void *c; char *n; @@ -159,15 +160,19 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char *function, function, pipes->pipes[i].name, (unsigned long long)idx); + saved_mem_ctx = ndr_pull->current_mem_ctx; + ndr_pull->current_mem_ctx = c; ndr_err = pipes->pipes[i].ndr_pull(ndr_pull, NDR_SCALARS, c); + ndr_pull->current_mem_ctx = saved_mem_ctx; status = ndr_map_error2ntstatus(ndr_err); printf("pull returned %s\n", nt_errstr(status)); if (!NT_STATUS_IS_OK(status)) { + talloc_free(c); return status; } pipes->pipes[i].ndr_print(ndr_print, n, c); - + talloc_free(c); if (*count == 0) { break; } |