fix some potential leaks in error cases. added --sax, to allow testing of
* parser.c: fix some potential leaks in error cases.
* xmllint.c: added --sax, to allow testing of --schemas --sax and
various other combinations.
* xmlschemas.c: fix a couple of tiny problems in
xmlSchemaValidateStream()
Daniel
diff --git a/parser.c b/parser.c
index 744fc83..37533f7 100644
--- a/parser.c
+++ b/parser.c
@@ -10410,7 +10410,7 @@
ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
- xmlFree(buf);
+ xmlFreeParserInputBuffer(buf);
return(NULL);
}
if (sax != NULL) {
@@ -10421,7 +10421,7 @@
ctxt->sax = (xmlSAXHandlerPtr) xmlMalloc(sizeof(xmlSAXHandler));
if (ctxt->sax == NULL) {
xmlErrMemory(ctxt, NULL);
- xmlFree(ctxt);
+ xmlFreeParserCtxt(ctxt);
return(NULL);
}
memset(ctxt->sax, 0, sizeof(xmlSAXHandler));