Commit df83c17e authored by Daniel Veillard's avatar Daniel Veillard

Fix a potential freeing error in XPath

parent ae874211
......@@ -11763,11 +11763,15 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
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);
goto evaluation_error;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment