aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2004-08-03 16:42:37 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2004-08-03 16:42:37 +0000
commit18a04f2a3c4d1803ac4f2e55da288ffd7bf9cf3b (patch)
tree4006c862b36e79288f0715b6c424385c152e21aa
parentd43cdcd6a27f720256ad7f008d36b74eee569b4e (diff)
downloadandroid_external_libxml2-18a04f2a3c4d1803ac4f2e55da288ffd7bf9cf3b.tar.gz
android_external_libxml2-18a04f2a3c4d1803ac4f2e55da288ffd7bf9cf3b.tar.bz2
android_external_libxml2-18a04f2a3c4d1803ac4f2e55da288ffd7bf9cf3b.zip
fixed problem with memory leak on text nodes in DTD (bug 148965) with
* tree.c: fixed problem with memory leak on text nodes in DTD (bug 148965) with patch provided by Darrell Kindred
-rw-r--r--ChangeLog5
-rw-r--r--tree.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b87163c2..3e09d298 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 3 09:42:31 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * tree.c: fixed problem with memory leak on text nodes in DTD
+ (bug 148965) with patch provided by Darrell Kindred
+
Tue Aug 3 08:14:44 PDT 2004 William Brack <wbrack@mmm.com.hk>
* HTMLparser.c: fixed initialisation problem for htmlReadMemory
diff --git a/tree.c b/tree.c
index 295066bc..cbf0664a 100644
--- a/tree.c
+++ b/tree.c
@@ -1020,12 +1020,15 @@ xmlFreeDtd(xmlDtdPtr cur) {
xmlNodePtr next, c = cur->children;
/*
- * Cleanup all the DTD comments they are not in the DTD
- * indexes.
+ * Cleanup all nodes which are not part of the specific lists
+ * of notations, elements, attributes and entities.
*/
while (c != NULL) {
next = c->next;
- if ((c->type == XML_COMMENT_NODE) || (c->type == XML_PI_NODE)) {
+ if ((c->type != XML_NOTATION_NODE) &&
+ (c->type != XML_ELEMENT_DECL) &&
+ (c->type != XML_ATTRIBUTE_DECL) &&
+ (c->type != XML_ENTITY_DECL)) {
xmlUnlinkNode(c);
xmlFreeNode(c);
}