Fix dangling pointer with xmllint --dropdtd

Reset doc->intSubset when dropping the DTD.
This commit is contained in:
Nick Wellnhofer 2021-04-22 19:24:50 +02:00
parent bf22713507
commit 72b3c067ce

View File

@ -2426,6 +2426,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
dtd = xmlGetIntSubset(doc);
if (dtd != NULL) {
xmlUnlinkNode((xmlNodePtr)dtd);
doc->intSubset = NULL;
xmlFreeDtd(dtd);
}
}