Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 96ef639d175c854f47fde91679da7cc85b02c2b2
Ticket: 2004654fffffffffffffffffffffffffffffffff
head: package require foo leaks
User & Date: das on 2008-06-28 09:12:51
Changes

  1. assignee changed to: "dgp"
  2. icomment:
    Logged In: YES 
    user_id=90580
    Originator: NO
    
    just ran into this as well...
    dgp's changes to Tcl_FSGetTranslatedPath() for bug 1972879 omit to decrease the ref count of  the result of the recursive call to Tcl_FSGetTranslatedPath(), the patch below fixes the leak for me, the same change is likely needed on core-8-5-branch and core-8-4-branch...
    
    Index: generic/tclPathObj.c
    ===================================================================
    RCS file: /cvsroot/tcl/tcl/generic/tclPathObj.c,v
    retrieving revision 1.70
    diff -u -p -r1.70 tclPathObj.c
    --- generic/tclPathObj.c24 Jun 2008 20:02:31 -00001.70
    +++ generic/tclPathObj.c28 Jun 2008 02:06:51 -0000
    @@ -1602,10 +1602,15 @@ Tcl_FSGetTranslatedPath(
          * translated version of cwdPtr to normPathPtr, we'll get the
          * translated result we need, and can store it for future use.
          */
    -    retObj = Tcl_FSJoinToPath(Tcl_FSGetTranslatedPath(interp,
    -    srcFsPathPtr->cwdPtr), 1, &(srcFsPathPtr->normPathPtr));
    +
    +    Tcl_Obj *translatedCwdPtr = Tcl_FSGetTranslatedPath(interp,
    +    srcFsPathPtr->cwdPtr);
    +
    +    retObj = Tcl_FSJoinToPath(translatedCwdPtr, 1,
    +    &(srcFsPathPtr->normPathPtr));
         srcFsPathPtr->translatedPathPtr = retObj;
         Tcl_IncrRefCount(retObj);
    +    Tcl_DecrRefCount(translatedCwdPtr);
     } else {
         /*
          * It is a pure absolute, normalized path object. This is
    
    
    
    
  3. login: "das"
  4. mimetype: "text/plain"
  5. priority changed to: "8"
  6. username: "das"