AST: Variable free'ed in error case 58/18458/3
Dhruv Khattar [Fri, 12 Aug 2016 20:26:06 +0000 (01:26 +0530)]
Change-Id: I18d1c67a10b8cd7e323647ae4eb42eefb2da105f

scilab/modules/api_scilab/src/cpp/api_stack_string.cpp

index 7d5c293..941dfcb 100644 (file)
@@ -813,6 +813,7 @@ int allocSingleString(void* _pvCtx, int _iVar, int _iLen, const char** _pstStrin
 
     if (pStr == NULL)
     {
+        delete[] pstStrings;
         addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocate variable"), "allocSingleString");
         return sciErr.iErr;
     }