data_structure: memleak while accessing a field 37/17137/1
Clément DAVID [Mon, 31 Aug 2015 08:13:53 +0000 (10:13 +0200)]
Change-Id: Ic04d5d29f3d6af733ef557aa10ace7d7029d6dfa

scilab/modules/data_structures/sci_gateway/cpp/sci_getfield.cpp

index 36b9700..092016a 100644 (file)
@@ -260,8 +260,11 @@ static types::Function::ReturnValue sci_getfieldUserType(types::typed_list &in,
         if (!properties->isString())
         {
             Scierror(999, _("%s: Could not read the argument #%d properties.\n"), "getfield", 2);
+            delete one[0];
             return types::Function::Error;
         }
+        delete one[0];
+
         types::String* propertiesStr = properties->getAs<types::String>();
 
         // Checking the index validity