mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
- valid.c tree.c parserInternals.c parser.c: Stephan Kulow
provided another failing case found in KDE, the way the ctxt->vctxt.nodeTab was allocated and freed changed over time but it wasn't completely cleaned up. This should fix it. Daniel
This commit is contained in:
12
tree.c
12
tree.c
@ -483,6 +483,8 @@ xmlNewDoc(const xmlChar *version) {
|
||||
*/
|
||||
void
|
||||
xmlFreeDoc(xmlDocPtr cur) {
|
||||
xmlDtdPtr extSubset, intSubset;
|
||||
|
||||
if (cur == NULL) {
|
||||
#ifdef DEBUG_TREE
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
@ -497,15 +499,17 @@ xmlFreeDoc(xmlDocPtr cur) {
|
||||
cur->ids = NULL;
|
||||
if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
|
||||
cur->refs = NULL;
|
||||
if (cur->extSubset != NULL) {
|
||||
extSubset = cur->extSubset;
|
||||
intSubset = cur->intSubset;
|
||||
if (extSubset != NULL) {
|
||||
xmlUnlinkNode((xmlNodePtr) cur->extSubset);
|
||||
xmlFreeDtd(cur->extSubset);
|
||||
cur->extSubset = NULL;
|
||||
xmlFreeDtd(extSubset);
|
||||
}
|
||||
if (cur->intSubset != NULL) {
|
||||
if (intSubset != NULL) {
|
||||
xmlUnlinkNode((xmlNodePtr) cur->intSubset);
|
||||
xmlFreeDtd(cur->intSubset);
|
||||
cur->intSubset = NULL;
|
||||
xmlFreeDtd(intSubset);
|
||||
}
|
||||
|
||||
if (cur->children != NULL) xmlFreeNodeList(cur->children);
|
||||
|
Reference in New Issue
Block a user