ndrdump: Fix a possible NULL pointer dereference
[kai/samba-autobuild/.git] / librpc / tools / ndrdump.c
index b1e96b8a84232131d1e1f109fa1e427cae25b848..e26d371942985e4f85939097559c204e39f066d9 100644 (file)
@@ -502,6 +502,10 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
                bool differ;
 
                ndr_v_push = ndr_push_init_ctx(mem_ctx);
+               if (ndr_v_push == NULL) {
+                       printf("No memory\n");
+                       exit(1);
+               }
 
                if (assume_ndr64) {
                        ndr_v_push->flags |= LIBNDR_FLAG_NDR64;