diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2004-11-29 13:08:03 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2004-11-29 13:08:03 +0000 |
commit | 7eca35fbaef6bd06074c4b978d381303609fcb0b (patch) | |
tree | 573210a01223727f5de88342f5484599fa55970a | |
parent | 66e40b14d5c8f4700312d8704e09902c7ddfc240 (diff) | |
download | libxml2-7eca35fbaef6bd06074c4b978d381303609fcb0b.tar.gz |
fixed a memory leak on errors in some circumstances #159812 Daniel
* xpath.c: fixed a memory leak on errors in some circumstances #159812
Daniel
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | xpath.c | 3 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Mon Nov 29 14:07:18 CET 2004 Daniel Veillard <daniel@veillard.com> + + * xpath.c: fixed a memory leak on errors in some circumstances #159812 + Fri Nov 26 23:20:48 HKT 2004 William Brack <wbrack@mmm.com.hk> * xmlIO.c: added a check within xmlOutputBufferWriteEscape to prevent @@ -3917,9 +3917,12 @@ xmlXPathNewContext(xmlDocPtr doc) { */ void xmlXPathFreeContext(xmlXPathContextPtr ctxt) { + if (ctxt == NULL) return; + xmlXPathRegisteredNsCleanup(ctxt); xmlXPathRegisteredFuncsCleanup(ctxt); xmlXPathRegisteredVariablesCleanup(ctxt); + xmlResetError(&ctxt->lastError); xmlFree(ctxt); } |