Artifacts Associated With Ticket 623269ffffffffff
Ticket change [759e2f5cf2] (rid 105420) by hobbs on 2002-10-14 22:20:33:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
From Jean Brouwers mrjean1 -> earthlink.net There is a memory leak in function Tcl_PutEnv() in file generic/tclEnv.c in 8.3.4 and earlier. Haven't checked later versions. The leak does only occur under specific conditions*. Here is an improved implementation for that function. int Tcl_PutEnv(string) CONST char *string;/* Info about environment variable in the * form NAME=value. (native) */ { Tcl_DString nameString; char *name, *value; if (string == NULL) { return 0; } /* * First convert the native string to UTF. Then separate the * string into name and value parts, and call TclSetEnv to do * all of the real work. */ name = Tcl_ExternalToUtfDString(NULL, string, -1, &nameString); value = strchr(name, '='); if (value != NULL && value != name) { value++ = '\0'; TclSetEnv(name, value); } Tcl_DStringFree(&nameString); return 0; } /Jean Brouwers *) In the original code, Tcl_DStringFree(&nameString) is not called if the input string does not contain a '=' or if the first character is '='. A memory leak will occur if string is large enough that additional memory was allocated for nameString. - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "hobbs"
- subsystem initialized to: "08. Environment Variables"
- title initialized to: "mem leak in Tcl_PutEnv."
- type initialized to: "Patch"
Ticket change [4591cce88d] (rid 99374) by hobbs on 2002-10-15 05:23:26:
- closedate changed to: "2002-10-14T22:23:26"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 fixed for 8.3.5 and 8.4.1.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "hobbs"