ndrdump: Do not run the validate step after a failure
[samba.git] / librpc / tools / ndrdump.c
index 23fbfa672821a858ac6df56c1c20b1d7534a7dc0..914c67e98e2124ebe3237c41ac635ede47e1ad8b 100644 (file)
@@ -638,6 +638,14 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
                }
        }
 
+       /* Do not proceed to validate if we got an error */
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               printf("dump of failed-to-parse %s complete\n",
+                      f->name);
+               TALLOC_FREE(mem_ctx);
+               exit(2);
+       }
+
        if (validate) {
                DATA_BLOB v_blob;
                struct ndr_push *ndr_v_push;