Skip to content
Tcl Source Code History Of Ticket 623269ffffffffff
Login

History Of Ticket 623269ffffffffff

Artifacts Associated With Ticket 623269ffffffffff

  1. Ticket change [759e2f5cf2] (rid 105420) by hobbs on 2002-10-14 22:20:33:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. 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. 
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "hobbs"
    9. subsystem initialized to: "08. Environment Variables"
    10. title initialized to: "mem leak in Tcl_PutEnv."
    11. type initialized to: "Patch"
  2. Ticket change [4591cce88d] (rid 99374) by hobbs on 2002-10-15 05:23:26:

    1. closedate changed to: "2002-10-14T22:23:26"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      fixed for 8.3.5 and 8.4.1.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"