From 86e16438b5c6b878894e01558c4d837e268a540c Mon Sep 17 00:00:00 2001 From: davygrvy Date: Wed, 14 May 2003 06:17:49 +0000 Subject: Another putenv() copy behavior problem repaired when compiling on windows and using microsoft's runtime. [Bug 736421] --- generic/tclEnv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic/tclEnv.c b/generic/tclEnv.c index 1d6e66f..f814164 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEnv.c,v 1.20 2003/01/14 02:06:11 mdejong Exp $ + * RCS: @(#) $Id: tclEnv.c,v 1.21 2003/05/14 06:17:49 davygrvy Exp $ */ #include "tclInt.h" @@ -429,6 +429,11 @@ TclUnsetEnv(name) if (environ[index] == string) { ReplaceString(oldValue, string); +#ifdef HAVE_PUTENV_THAT_COPIES + } else { + /* This putenv() copies instead of taking ownership */ + ckfree(string); +#endif } #else for (envPtr = environ+index+1; ; envPtr++) { -- cgit v0.12