Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_Obj leak in TclpObjNormalizePath (tclWinFile.c)

Closed / Fixed2688184fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2009-03-16 04:08:25
The TclpObjNormalizePath function in tclWinFile.c has an object leak.  The original object is allocated here:

Tcl_Obj *to = WinReadLinkDirectory(nativePath);

The value of the "to" variable is later assigned to the "temp" variable:  

if (temp != NULL) {
    Tcl_DecrRefCount(temp);
}
temp = to;

The intermediate values of the "temp" variable are properly freed; however, the final value of the "temp" variable is not freed after the containing while loop exits.

The simplest way to I have found to reproduce this leak is to use [file normalize] on a path that uses NT reparse points.

This leak also appears to impact Tcl 8.4 and 8.5.
mistachkinplain2009-03-16 11:28:45
File Added - 317988: tclWinFile.zip

Patch (against HEAD) with fix attached.

File Added: tclWinFile.zip
dgp Ticket [2688184fff]: 2 changes [History diff]2009-03-16 22:25:44
dgpplain2009-03-19 00:08:42
Patch looks correct.  Committing to HEAD...
dgpplain2009-03-19 00:19:10
allow_comments - 1


backports complete.
Log in (anonymous is fine) to add a comment.

Attachments: