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 /xpath.c | |
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
Diffstat (limited to 'xpath.c')
-rw-r--r-- | xpath.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); } |