summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclEnv.c15
2 files changed, 10 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 03b2de4..3eba000 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tclEnv.c (Tcl_PutEnv): correct possible mem leak.
+ [Patch #623269] (brouwers)
+
2002-10-11 Donal K. Fellows <fellowsd@cs.man.ac.uk>
* generic/tcl.h: Need a different strategy through the maze of
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 3702ff4..e0e2739 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.18 2002/09/27 00:50:10 hobbs Exp $
+ * RCS: @(#) $Id: tclEnv.c,v 1.19 2002/10/14 22:25:10 hobbs Exp $
*/
#include "tclInt.h"
@@ -326,7 +326,6 @@ Tcl_PutEnv(string)
* form NAME=value. (native) */
{
Tcl_DString nameString;
- int nameLength;
CONST char *name;
char *value;
@@ -342,16 +341,12 @@ Tcl_PutEnv(string)
name = Tcl_ExternalToUtfDString(NULL, string, -1, &nameString);
value = strchr(name, '=');
- if (value == NULL) {
- return 0;
- }
- nameLength = value - name;
- if (nameLength == 0) {
- return 0;
+
+ if ((value != NULL) && (value != name)) {
+ value[0] = '\0';
+ TclSetEnv(name, value+1);
}
- value[0] = '\0';
- TclSetEnv(name, value+1);
Tcl_DStringFree(&nameString);
return 0;
}