memory leak in arrayof fixed 73/17373/3
Cedric Delamarre [Thu, 22 Oct 2015 12:21:09 +0000 (14:21 +0200)]
Change-Id: I0c5f421745ea3ef51128d1b9438dd4b28601ff65

scilab/modules/ast/src/cpp/types/arrayof.cpp

index 0b2902b..3e35362 100644 (file)
@@ -958,7 +958,6 @@ InternalType* ArrayOf<T>::remove(typed_list* _pArgs)
     {
         pOut = createEmpty(iDims, piNewDims, m_pImgData != NULL);
 
-        delete[] piNewDims;
         //find a way to copy existing data to new variable ...
         int iNewPos = 0;
         int* piIndexes = new int[iOrigDims];
@@ -1000,6 +999,8 @@ InternalType* ArrayOf<T>::remove(typed_list* _pArgs)
         delete[] piViewDims;
     }
 
+    delete[] piNewDims;
+
     //free pArg content
     cleanIndexesArguments(_pArgs, &pArg);