summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-01-11 20:38:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:50:54 -0500
commitd68b0b12b956b4b70953806e8cb4d9f6207057ed (patch)
treea893fd31c573b1ced9c8f4f93d7bb2af6321186a /source4
parent0b3deb20defaedb0570c17ec8b28e5d11979cb35 (diff)
downloadsamba-d68b0b12b956b4b70953806e8cb4d9f6207057ed.tar.gz
samba-d68b0b12b956b4b70953806e8cb4d9f6207057ed.tar.bz2
samba-d68b0b12b956b4b70953806e8cb4d9f6207057ed.zip
r12856: make the logic much more sane
metze (This used to be commit ed4a3e53fd71679fbdfc2f2932c1098e03026285)
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/ndr/ndr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index 9e307a3f38..a7f34ec002 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -272,16 +272,20 @@ char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
int flags, void *ptr)
{
struct ndr_print *ndr;
- char *ret;
+ char *ret = NULL;
ndr = talloc_zero(mem_ctx, struct ndr_print);
if (!ndr) return NULL;
- ndr->private = talloc_strdup(mem_ctx, "");
+ ndr->private = talloc_strdup(ndr, "");
+ if (!ndr->private) {
+ goto failed;
+ }
ndr->print = ndr_print_string_helper;
ndr->depth = 1;
ndr->flags = 0;
fn(ndr, name, flags, ptr);
- ret = ndr->private;
+ ret = talloc_steal(mem_ctx, ndr->private);
+failed:
talloc_free(ndr);
return ret;
}