From 96daa4036a425ff3f23a7dfcba57bfb0f942bec6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 11 Mar 2020 08:49:42 -0600 Subject: [PATCH] fix apparent free-ordering issue reported in #7926 --- libs/pbd/xml++.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 598a7684b3..e09af7602b 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -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."); }