summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-28 15:03:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-28 21:08:16 +0100
commitc4542dd3534e5e05307938bb7627017fb8a883cb (patch)
tree3e0e11451985a78f19dd746d67a5f0919de422e5 /sax
parent82094065a134f00db11db870c0c378943cd18e98 (diff)
ofz#28733 Direct-leak
free xmlEntityPtr the way desret_xmlEntityPtr does in libxml's testapi.c Change-Id: Ia809413c3d4e7b13e799e6c1a57e8abe61bf218d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108415 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/fastparser/fastparser.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 9d13d25ce385..6bfa1ce0e205 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -676,7 +676,13 @@ FastSaxParserImpl::~FastSaxParserImpl()
if( mxDocumentLocator.is() )
mxDocumentLocator->dispose();
for ( size_t i = 0; i < m_TemporalEntities.size(); ++i )
- if (m_TemporalEntities[i] != nullptr) xmlFree(m_TemporalEntities[i]);
+ {
+ if (!m_TemporalEntities[i])
+ continue;
+ xmlNodePtr pPtr = reinterpret_cast<xmlNodePtr>(m_TemporalEntities[i]);
+ xmlUnlinkNode(pPtr);
+ xmlFreeNode(pPtr);
+ }
}
void FastSaxParserImpl::DefineNamespace( const OString& rPrefix, const OUString& namespaceURL )