[Libreoffice-commits] core.git: starmath/source

Caolán McNamara caolanm at redhat.com
Sat Dec 2 20:16:48 UTC 2017


 starmath/source/mathmlimport.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit caf17df4d90ba6cff80846864a5e56c93af3756b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Dec 2 15:41:16 2017 +0000

    ofz: fix leak
    
    null out the transferred one and delete the remainder
    
    Change-Id: Iacf2ab46c76234ea558588114e1bcdea370577d0
    Reviewed-on: https://gerrit.libreoffice.org/45716
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 04ccf8bd9e6e..6e7001214541 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -2426,7 +2426,10 @@ void SmXMLRowContext_Impl::EndElement()
             {
                 aRelationArray2.resize(nRelArrSize);
                 for (int i=0;i < nRelArrSize;i++)
+                {
                     aRelationArray2[i] = aRelationArray[i+nLeft];
+                    aRelationArray[i+nLeft] = nullptr;
+                }
             }
 
             SmToken aDummy;
@@ -2437,6 +2440,10 @@ void SmXMLRowContext_Impl::EndElement()
             pSNode->SetSubNodes(pLeft,pBody,pRight);
             pSNode->SetScaleMode(SmScaleMode::Height);
             rNodeStack.push_front(std::move(pSNode));
+
+            for (auto a : aRelationArray)
+                delete a;
+
             return;
         }
     }


More information about the Libreoffice-commits mailing list