3 @@ -11763,11 +11763,16 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
5 if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
8 + /* pop the result if any */
10 - xmlXPathReleaseObject(xpctxt, tmp);
11 - /* then pop off contextObj, which will be freed later */
13 + if (tmp != contextObj) {
15 + * Free up the result
16 + * then pop off contextObj, which will be freed later
18 + xmlXPathReleaseObject(xpctxt, tmp);
21 goto evaluation_error;