* Bug 16654 fixed: interp1 was leaking memory 08/21708/2
Antoine ELIAS [Mon, 8 Mar 2021 10:25:36 +0000 (11:25 +0100)]
http://bugzilla.scilab.org/show_bug.cgi?id=16654

Change-Id: Iabbb4d15976e97f341ce6291f137743e8bd84f1c

scilab/CHANGES.md
scilab/modules/interpolation/sci_gateway/cpp/sci_interp.cpp

index 4a9d975..3c27968 100644 (file)
@@ -357,6 +357,7 @@ Bug Fixes
 * [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers.
 * [#16623](https://bugzilla.scilab.org/16623): `rand(2,2,2)^2` yielded a wrong result instead of trying to call the `%s_p_s` overload for input hypermatrices.
 * [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input.
+* [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory.
 
 
 ### Bugs fixed in 6.1.0:
index 32df139..3c3c91f 100644 (file)
@@ -190,16 +190,28 @@ types::Function::ReturnValue sci_interp(types::typed_list &in, int _iRetCount, t
     {
         out.push_back(pDblYp1);
     }
+    else
+    {
+        pDblYp1->killMe();
+    }
 
     if (_iRetCount > 2)
     {
         out.push_back(pDblYp2);
     }
+    else
+    {
+        pDblYp2->killMe();
+    }
 
     if (_iRetCount > 3)
     {
         out.push_back(pDblYp3);
     }
+    else
+    {
+        pDblYp3->killMe();
+    }
 
     return types::Function::OK;
 }