1
0
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:
Daniel Veillard
2001-06-19 11:07:54 +00:00
parent 3ed27bdef0
commit a9142e74c5
5 changed files with 24 additions and 17 deletions

12
tree.c
View File

@ -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);