invalid read and memleak fixed 42/17142/2
Cedric Delamarre [Mon, 31 Aug 2015 10:36:07 +0000 (12:36 +0200)]
Change-Id: Iac2914d6f5cfbc1df7c68d4944623d4adc1d68aa

scilab/modules/ast/src/cpp/symbol/libraries.cpp
scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp

index d74e9ef..bae82ed 100644 (file)
@@ -172,8 +172,6 @@ bool Libraries::remove(const Symbol& _key, int _iLevel)
             if (it->second->top()->m_iLevel == _iLevel)
             {
                 ScopedLibrary * pSL = it->second->top();
-                types::Library* pIT = pSL->m_pLib;
-                pIT->killMe();
                 it->second->pop();
                 delete pSL;
                 return true;
index 878d661..f578330 100644 (file)
@@ -161,6 +161,7 @@ types::Function::ReturnValue sci_exec(types::typed_list &in, int _iRetCount, typ
         /*fake call to mopen to show file within file()*/
         if (mopen(pwstTemp, L"r", 0, &iID) != MOPEN_NO_ERROR)
         {
+            delete file;
             FREE(pwstTemp);
             Scierror(999, _("%s: Cannot open file %s.\n"), "exec", stFile.data());
             return Function::Error;