summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2006-04-13 07:33:44 +0000
committerDaniel Veillard <veillard@src.gnome.org>2006-04-13 07:33:44 +0000
commit3f845a99b984778269784281ab79489b251209f5 (patch)
treea23e8c36d0f2db3d5e81aa3d52dc41e3986a032b
parent51698c71efe87a3015d91fb07259119267cbd050 (diff)
downloadlibxml2-3f845a99b984778269784281ab79489b251209f5.tar.gz
fixing a deallocation problem in xmlRelaxNGParse() in case of errors,
* relaxng.c: fixing a deallocation problem in xmlRelaxNGParse() in case of errors, should fix bug #338306 Daniel
-rw-r--r--ChangeLog5
-rw-r--r--relaxng.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 97b14f9b..de1ac0f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Apr 13 09:31:45 CEST 2006 Daniel Veillard <daniel@veillard.com>
+
+ * relaxng.c: fixing a deallocation problem in xmlRelaxNGParse()
+ in case of errors, should fix bug #338306
+
Thu Apr 6 10:22:17 CEST 2006 Daniel Veillard <daniel@veillard.com>
* doc/xmlcatalog.1 doc/xmlcatalog_man.xml doc/xmllint.1 doc/xmllint.xml:
diff --git a/relaxng.c b/relaxng.c
index 59780c80..45eef130 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -7394,13 +7394,16 @@ xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt)
if (root == NULL) {
xmlRngPErr(ctxt, (xmlNodePtr) doc,
XML_RNGP_EMPTY, "xmlRelaxNGParse: %s is empty\n",
- ctxt->URL, NULL);
- xmlFreeDoc(doc);
+ (ctxt->URL ? ctxt->URL : "schemas"), NULL);
+
+ xmlFreeDoc(ctxt->document);
+ ctxt->document = NULL;
return (NULL);
}
ret = xmlRelaxNGParseDocument(ctxt, root);
if (ret == NULL) {
- xmlFreeDoc(doc);
+ xmlFreeDoc(ctxt->document);
+ ctxt->document = NULL;
return (NULL);
}