starmath/source/mathmlimport.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 5a075c693c9256c531220cd206cd9a5ef560ae48
Author: Caolán McNamara <[email protected]>
Date:   Fri Dec 1 17:33:20 2017 +0000

    ofz: mem leak
    
    Change-Id: I4dc4ff6b2c4bdbcc2c705651a85886441ad90e64
    Reviewed-on: https://gerrit.libreoffice.org/45692
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

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;
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to