summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-30 10:39:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-30 13:58:19 +0200
commit8148a46c7878158c4b701e2a5c374129e6ffdffc (patch)
treed6a90e4a2946f1a71e16d5780bf16d1f46e5b3fc /tools
parent3d32baa4df8d4061efcd5c5aa0a381e9a75240fa (diff)
no need to copy the name in XmlWalker::attribute
sName and the parameter we pass to xmlGetProp are both null-terminated char strings Change-Id: Ia8cb036f33cada8fa59d1e4f05df318a9cf28115 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/xml/XmlWalker.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/source/xml/XmlWalker.cxx b/tools/source/xml/XmlWalker.cxx
index 34a3d8746f6b..73199b4b665d 100644
--- a/tools/source/xml/XmlWalker.cxx
+++ b/tools/source/xml/XmlWalker.cxx
@@ -98,12 +98,11 @@ void XmlWalker::parent()
OString XmlWalker::attribute(const OString& sName)
{
- xmlChar* xmlName = xmlCharStrdup(sName.getStr());
- xmlChar* xmlAttribute = xmlGetProp(mpImpl->mpCurrent, xmlName);
+ xmlChar* xmlAttribute
+ = xmlGetProp(mpImpl->mpCurrent, reinterpret_cast<const xmlChar*>(sName.getStr()));
OString aAttributeContent(
xmlAttribute == nullptr ? "" : reinterpret_cast<const char*>(xmlAttribute));
xmlFree(xmlAttribute);
- xmlFree(xmlName);
return aAttributeContent;
}