Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-03-19
00:19 • Closed ticket [2688184fff]: Tcl_Obj leak in TclpObjNormalizePath (tclWinFile.c)<... artifact: 693e958ff4 user: dgp
00:08 • Ticket [2688184fff]: 4 changes artifact: d2bd62beca user: dgp
2009-03-16
22:25 • Ticket [2688184fff]: 2 changes artifact: b49ed4a387 user: dgp
11:28 • Ticket [2688184fff]: 4 changes artifact: 0d7f62385c user: mistachkin
11:28 • Add attachment tclWinFile.zip to ticket [2688184fff] artifact: 90ebd7dab4 user: mistachkin
04:08 • New ticket [2688184fff] Tcl_Obj leak in TclpObjNormalizePath (tclWinFile.c). artifact: 38ee0504dd user: mistachkin

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: