]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: duplicate env var (strdup) before calling putenv that does not copy the string
authorcaremoli <caremoli>
Wed, 17 Mar 2010 17:31:54 +0000 (17:31 +0000)
committercaremoli <caremoli>
Wed, 17 Mar 2010 17:31:54 +0000 (17:31 +0000)
memory leak but small

src/Container/Container_i.cxx

index 1a838c60fa1bbc65a65a4bc11d301c03dbf9ffc8..4197e70ebda680f98c087c6c90b8cb4d3c3d1698 100644 (file)
@@ -756,7 +756,7 @@ Engines_Container_i::create_component_instance_env(const char*genericRegisterNam
               std::string s(env[i].key);
               s+='=';
               s+=value;
-              putenv((char *)s.c_str());
+              putenv(strdup(s.c_str()));
             }
         }