r6188: correct fix for rev 6182
authorStefan Metzmacher <metze@samba.org>
Mon, 4 Apr 2005 05:52:53 +0000 (05:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:11:24 +0000 (13:11 -0500)
we should start with an empty switch_list
in ndr_print as we do for ndr_pull/ndr_push

metze

source/librpc/ndr/ndr.c

index 3a7ad7f29e3b344d55f6a9a8ae6e2dae8ff87756..c5360ee66434cde9fa49132f76e5cd6764256172 100644 (file)
@@ -315,16 +315,12 @@ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr)
 {
        struct ndr_print *ndr;
 
-       ndr = talloc(NULL, struct ndr_print);
+       ndr = talloc_zero(NULL, struct ndr_print);
        if (!ndr) return;
        ndr->print = ndr_print_debug_helper;
        ndr->depth = 1;
        ndr->flags = 0;
-       ndr->switch_list = talloc(ndr, struct ndr_token_list);
-       if (!ndr->switch_list)
-               goto fail;
        fn(ndr, name, ptr);
-fail:
        talloc_free(ndr);
 }
 
@@ -335,7 +331,7 @@ void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int fla
 {
        struct ndr_print *ndr;
 
-       ndr = talloc(NULL, struct ndr_print);
+       ndr = talloc_zero(NULL, struct ndr_print);
        if (!ndr) return;
        ndr->print = ndr_print_debug_helper;
        ndr->depth = 1;