diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-12-01 17:33:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-12-02 12:55:40 +0100 |
commit | 5a075c693c9256c531220cd206cd9a5ef560ae48 (patch) | |
tree | 99fdfc2f8df6c890b16c84aa2cfd796a255d0915 /starmath | |
parent | e90f86db77476f16a28c44c96771c925c6172d6d (diff) |
ofz: mem leak
Change-Id: I4dc4ff6b2c4bdbcc2c705651a85886441ad90e64
Reviewed-on: https://gerrit.libreoffice.org/45692
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/mathmlimport.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 2147001061de..04ccf8bd9e6e 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -2638,10 +2638,9 @@ void SmXMLTableContext_Impl::EndElement() auto nRows = rNodeStack.size()-nElementCount; sal_uInt16 nCols = 0; - SmStructureNode *pArray; for (auto i=nRows;i > 0;i--) { - pArray = static_cast<SmStructureNode *>(rNodeStack.front().release()); + SmStructureNode* pArray = static_cast<SmStructureNode *>(rNodeStack.front().release()); rNodeStack.pop_front(); if (pArray->GetNumSubNodes() == 0) { @@ -2669,10 +2668,11 @@ void SmXMLTableContext_Impl::EndElement() size_t j=0; while ( !aReverseStack.empty() ) { - pArray = static_cast<SmStructureNode *>(aReverseStack.front().release()); + std::unique_ptr<SmStructureNode> xArray(static_cast<SmStructureNode*>(aReverseStack.front().release())); aReverseStack.pop_front(); - for (sal_uInt16 i=0;i<pArray->GetNumSubNodes();i++) - aExpressionArray[j++] = pArray->GetSubNode(i); + for (sal_uInt16 i = 0; i < xArray->GetNumSubNodes(); ++i) + aExpressionArray[j++] = xArray->GetSubNode(i); + xArray->SetSubNodes(SmNodeArray()); } SmToken aToken; |