summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2007-08-23 12:58:13 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2007-08-23 12:58:13 +0000
commitf179456d0f82225ef32196d4947a565bed1b59cb (patch)
tree6786bcb7fdff64194a0d95602b62f7e89b8cfd4d /xpath.c
parent3888f472631b7b6005aae57e7ea58b917253a2a8 (diff)
downloadlibxml2-f179456d0f82225ef32196d4947a565bed1b59cb.tar.gz
fixed mlXPathCompOpEvalPositionalPredicate problem with object caching
* xpath.c: fixed mlXPathCompOpEvalPositionalPredicate problem with object caching (bug #469410) svn path=/trunk/; revision=3653
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xpath.c b/xpath.c
index 9c4db87c..22a3f9d0 100644
--- a/xpath.c
+++ b/xpath.c
@@ -11706,8 +11706,15 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
valuePush(ctxt, contextObj);
res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1);
- if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1))
+ if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
+ xmlXPathObjectPtr tmp;
+ /* pop the result */
+ tmp = valuePop(ctxt);
+ xmlXPathReleaseObject(xpctxt, tmp);
+ /* then pop off contextObj, which will be freed later */
+ valuePop(ctxt);
goto evaluation_error;
+ }
if (res)
pos++;