AST: fix mismatched use of malloc/new/new[] versus free/delete/delete[] 06/17106/2
Clément DAVID [Tue, 25 Aug 2015 13:54:09 +0000 (15:54 +0200)]
Change-Id: Idd835ec34bd87d4bb26ff778cdaa7f66573d2be1

scilab/modules/ast/src/cpp/operations/types_divide.cpp
scilab/modules/ast/src/cpp/system_env/configvariable.cpp

index bc6d775..02cad5a 100644 (file)
@@ -566,9 +566,9 @@ int RDivideSparseByDouble(types::Sparse* _pSp, types::Double* _pDouble, Internal
         }
     }
 
-    delete Col;
-    delete Row;
-    delete iPositVal;
+    delete[] Col;
+    delete[] Row;
+    delete[] iPositVal;
 
     for (int i = 0; i < iSize; ++i)
     {
index ca0e64a..b610373 100644 (file)
@@ -693,7 +693,7 @@ void ConfigVariable::removeDynamicLibrary(int _iDynamicLibraryIndex)
                 EntryPointStr* pEP = *it;
                 m_EntryPointList.remove(*it);
                 FREE(pEP->pwstEntryPointName);
-                delete pEP;
+                FREE(pEP);
                 if (m_EntryPointList.size() == 0)
                 {
                     break;
@@ -703,7 +703,7 @@ void ConfigVariable::removeDynamicLibrary(int _iDynamicLibraryIndex)
         }
         //remove dynamic library
         FREE(m_DynLibList[_iDynamicLibraryIndex]->pwstLibraryName);
-        delete m_DynLibList[_iDynamicLibraryIndex];
+        FREE(m_DynLibList[_iDynamicLibraryIndex]);
         m_DynLibList[_iDynamicLibraryIndex] = NULL;
     }