Index: third_party/libxml/src/xpath.c |
=================================================================== |
--- third_party/libxml/src/xpath.c (revision 66188) |
+++ third_party/libxml/src/xpath.c (working copy) |
@@ -11752,11 +11752,15 @@ |
if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) { |
xmlXPathObjectPtr tmp; |
- /* pop the result */ |
+ /* pop the result if any */ |
tmp = valuePop(ctxt); |
- xmlXPathReleaseObject(xpctxt, tmp); |
- /* then pop off contextObj, which will be freed later */ |
- valuePop(ctxt); |
+ if (tmp != contextObj) |
+ /* |
+ * Free up the result |
+ * then pop off contextObj, which will be freed later |
+ */ |
+ xmlXPathReleaseObject(xpctxt, tmp); |
+ valuePop(ctxt); |
Cris Neckar
2010/11/18 00:53:04
ugly indent
|
goto evaluation_error; |
} |