From 5e2736b0b30713c1d188d70b46a32262eed32b7c Mon Sep 17 00:00:00 2001 From: caremoli Date: Wed, 17 Mar 2010 17:31:54 +0000 Subject: [PATCH] CCAR: duplicate env var (strdup) before calling putenv that does not copy the string memory leak but small --- src/Container/Container_i.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 1a838c60f..4197e70eb 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -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())); } } -- 2.39.2