Fixed memory bug with invalid function reported by Francois Delyon on
* xpath.c: Fixed memory bug with invalid function reported by Francois Delyon on mailing list
svn path=/trunk/; revision=3584
diff --git a/xpath.c b/xpath.c
index 107b270..aa573a6 100644
--- a/xpath.c
+++ b/xpath.c
@@ -11544,8 +11544,11 @@
res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1);
- if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1))
- goto evaluation_error;
+ if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
+ xmlXPathNodeSetClear(set, hasNsNodes);
+ newContextSize = 0;
+ goto evaluation_exit;
+ }
if (res != 0) {
newContextSize++;
@@ -11573,18 +11576,13 @@
contextObj = NULL;
}
}
- goto evaluation_exit;
-evaluation_error:
- xmlXPathNodeSetClear(set, hasNsNodes);
- newContextSize = 0;
-
-evaluation_exit:
if (contextObj != NULL) {
if (ctxt->value == contextObj)
valuePop(ctxt);
xmlXPathReleaseObject(xpctxt, contextObj);
}
+evaluation_exit:
if (exprRes != NULL)
xmlXPathReleaseObject(ctxt->context, exprRes);
/*