13
0

fix apparent free-ordering issue reported in #7926

This commit is contained in:
Paul Davis 2020-03-11 08:49:42 -06:00
parent 12c4a88db6
commit 96daa4036a

View File

@ -770,16 +770,16 @@ static XMLSharedNodeList* find_impl(xmlXPathContext* ctxt, const string& xpath)
xmlXPathObject* result = xmlXPathEval((const xmlChar*)xpath.c_str(), ctxt);
if (!result) {
xmlXPathFreeContext(ctxt);
xmlFreeDoc(ctxt->doc);
xmlXPathFreeContext(ctxt);
throw XMLException("Invalid XPath: " + xpath);
}
if (result->type != XPATH_NODESET) {
xmlXPathFreeObject(result);
xmlXPathFreeContext(ctxt);
xmlFreeDoc(ctxt->doc);
xmlXPathFreeContext(ctxt);
throw XMLException("Only nodeset result types are supported.");
}