[libxml2] 447899 potential double free in xmlFreeTextReader
- From: Daniel Veillard <veillard src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libxml2] 447899 potential double free in xmlFreeTextReader
- Date: Fri, 21 Aug 2009 16:42:19 +0000 (UTC)
commit f4653dcd8be8b2b44814b9a3fd358a7bbb87b8c4
Author: Daniel Veillard <veillard redhat com>
Date: Fri Aug 21 18:40:50 2009 +0200
447899 potential double free in xmlFreeTextReader
* xmlreader.c: a document may still be referenced by fakenode,
just free fakenode before freeing the document.
xmlreader.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/xmlreader.c b/xmlreader.c
index eda32f3..1e562c2 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -2214,6 +2214,9 @@ xmlFreeTextReader(xmlTextReaderPtr reader) {
xmlFree(reader->patternTab);
}
#endif
+ if (reader->faketext != NULL) {
+ xmlFreeNode(reader->faketext);
+ }
if (reader->ctxt != NULL) {
if (reader->dict == reader->ctxt->dict)
reader->dict = NULL;
@@ -2235,9 +2238,6 @@ xmlFreeTextReader(xmlTextReaderPtr reader) {
xmlFree(reader->sax);
if ((reader->input != NULL) && (reader->allocs & XML_TEXTREADER_INPUT))
xmlFreeParserInputBuffer(reader->input);
- if (reader->faketext != NULL) {
- xmlFreeNode(reader->faketext);
- }
if (reader->buffer != NULL)
xmlBufferFree(reader->buffer);
if (reader->entTab != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]