summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-07-04 18:19:34 +0200
committerJulien Nabet <serval2412@yahoo.fr>2019-07-04 19:27:46 +0200
commit1d29534e11c437c1b47135b64684da542fba2a64 (patch)
tree97f1742e28f300ab270113c23f3d622facec2c29 /test
parent72d88049bdac3417f6833255dff5a06a0f3eb1c3 (diff)
cid#1448515: Resource leak (test/xmltesttools)
Change-Id: Ifadb599697fca738a41e4aad098edf4de32e174f Reviewed-on: https://gerrit.libreoffice.org/75096 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
Diffstat (limited to 'test')
-rw-r--r--test/source/xmltesttools.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 3c186dd08d63..42eeddc12bc3 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -85,7 +85,10 @@ OUString XmlTestTools::getXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const
CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("In <" + OString(pXmlDoc->name) + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(),
1, xmlXPathNodeSetGetLength(pXmlNodes));
if (rAttribute.isEmpty())
+ {
+ xmlXPathFreeObject(pXmlObj);
return OUString();
+ }
xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
xmlChar * prop = xmlGetProp(pXmlNode, BAD_CAST(rAttribute.getStr()));
OString sAttAbsent = "In <" + OString(pXmlDoc->name) + ">, XPath '" + rXPath