Coverity #1321214, #1321215, #1321217, #1321220, #1321223, #1321224, #1321221, #13212...
[scilab.git] / scilab / modules / optimization / sci_gateway / cpp / sci_lsqrsolve.cpp
index 3cbf0b6..fa63b39 100644 (file)
@@ -373,31 +373,31 @@ types::Function::ReturnValue sci_lsqrsolve(types::typed_list &in, int _iRetCount
         Scierror(999, pstrMsg);
         FREE(pstrMsg);
         delete pDblX;
-        delete piPvt;
-        delete pDblQtf;
-        delete pdblWork1;
-        delete pdblWork2;
-        delete pdblWork3;
-        delete pdblWork4;
-        delete pdblJac;
+        delete[] piPvt;
+        delete[] pDblQtf;
+        delete[] pdblWork1;
+        delete[] pdblWork2;
+        delete[] pdblWork3;
+        delete[] pdblWork4;
+        delete[] pdblJac;
         if (iMode != 2)
         {
-            delete pdblDiag;
+            delete[] pdblDiag;
         }
 
         return types::Function::Error;
     }
 
-    delete piPvt;
-    delete pDblQtf;
-    delete pdblWork1;
-    delete pdblWork2;
-    delete pdblWork3;
-    delete pdblWork4;
-    delete pdblJac;
+    delete[] piPvt;
+    delete[] pDblQtf;
+    delete[] pdblWork1;
+    delete[] pdblWork2;
+    delete[] pdblWork3;
+    delete[] pdblWork4;
+    delete[] pdblJac;
     if (iMode != 2)
     {
-        delete pdblDiag;
+        delete[] pdblDiag;
     }
 
     /*** return output arguments ***/