| Index: third_party/libxml/src/xpath.c
|
| ===================================================================
|
| --- third_party/libxml/src/xpath.c (revision 66837)
|
| +++ 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);
|
| goto evaluation_error;
|
| }
|
|
|
|
|