Coverity #1321334, #1321335, #1321338 fixed: Resource Leaks 33/18133/3
Dhruv Khattar [Fri, 29 Apr 2016 22:48:41 +0000 (03:48 +0530)]
Change-Id: I896dc08d34b0bb29f7e13de39df0b14b19c5ee73

scilab/modules/linear_algebra/sci_gateway/cpp/sci_lu.cpp
scilab/modules/linear_algebra/src/c/hess.c

index 54e7d9d..6eb5526 100644 (file)
@@ -125,6 +125,11 @@ types::Function::ReturnValue sci_lu(types::typed_list &in, int _iRetCount, types
     if (iRet != 0)
     {
         Scierror(999, _("%s: LAPACK error n°%d.\n"), "lu", iRet);
+        FREE((doublecomplex*)pdL);
+        FREE((doublecomplex*)pdU);
+        delete pDblL;
+        delete pDblU;
+        delete pDblE;
         return types::Function::Error;
     }
 
index 0f173f4..d36e36d 100644 (file)
@@ -89,6 +89,8 @@ int iHessM(double * pData, int iCols, int complexArg, double* pH)
     {
         ret = 1; /* there should be an error cond enum for inner routines that should not depend on macro _ */
     }
+    FREE(pWork);
+    FREE(pTau);
     return ret;
 }