Scicos src: fix memleaks 39/17139/3
Paul Bignier [Mon, 31 Aug 2015 08:35:47 +0000 (10:35 +0200)]
Change-Id: I10aa444cf142eb58230c675a865252882972840b

scilab/modules/scicos/src/cpp/sciblk2.cpp

index 1b37c62..2ee9d6a 100644 (file)
@@ -82,11 +82,19 @@ void sciblk2(int* flag, int* nevprt, double* t, double xd[], double x[], int* nx
         if (!vec2var(std::vector<double>(z, z + *nz), Z))
         {
             setErrAndFree(-1, out);
+            delete in[0];
+            delete in[1];
+            delete in[2];
+            delete in[3];
             return;
         }
         if (!Z->isDouble())
         {
             setErrAndFree(-1, out);
+            delete in[0];
+            delete in[1];
+            delete in[2];
+            delete in[3];
             return;
         }
         //types::Double* Z = new types::Double(*nz, 1);