mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
parser: Pop input stream in xmlCtxtValidateDtd
This commit is contained in:
parent
5204c872bb
commit
eae9a1bd8b
9
parser.c
9
parser.c
@ -11778,7 +11778,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
|
||||
xmlDtdPtr
|
||||
xmlCtxtParseDtd(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
||||
const xmlChar *publicId, const xmlChar *systemId) {
|
||||
xmlDtdPtr ret;
|
||||
xmlDtdPtr ret = NULL;
|
||||
|
||||
if (xmlCtxtPushInput(ctxt, input) < 0) {
|
||||
xmlFreeInputStream(input);
|
||||
@ -11793,7 +11793,7 @@ xmlCtxtParseDtd(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
||||
ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
|
||||
if (ctxt->myDoc == NULL) {
|
||||
xmlErrMemory(ctxt);
|
||||
return(NULL);
|
||||
goto error;
|
||||
}
|
||||
ctxt->myDoc->properties = XML_DOC_INTERNAL;
|
||||
ctxt->myDoc->extSubset = xmlNewDtd(ctxt->myDoc, BAD_CAST "none",
|
||||
@ -11801,7 +11801,7 @@ xmlCtxtParseDtd(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
||||
if (ctxt->myDoc->extSubset == NULL) {
|
||||
xmlErrMemory(ctxt);
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
return(NULL);
|
||||
goto error;
|
||||
}
|
||||
|
||||
xmlParseExternalSubset(ctxt, publicId, systemId);
|
||||
@ -11825,6 +11825,9 @@ xmlCtxtParseDtd(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
ctxt->myDoc = NULL;
|
||||
|
||||
error:
|
||||
xmlFreeInputStream(xmlCtxtPopInput(ctxt));
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user