Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Potential mem leak in TcpGetOptionProc if host name too long

Closed / Fixed888777ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2004-02-01 23:41:26
In unix/tclUnixChan.c, TcpGetOptionProc,
options -peername and -sockname.
if the size of the hostname returned by the system
causes Tcl to allocate memory for Tcl_DString 'ds',
that memory will never be freed.

I have tested this with:
while {1} {fconfigure $sock -peername}
hostname <= 195 chars - ok
hostname > 195 chars - memory leak 

Patch included for Tcl-8.4.5

Stu
stwoplain2004-02-02 06:41:26
File Added - 75432: patch-unix_tclUnixChan_c-DStringFree
dkf Closed ticket [888777ffff]. [History diff]2004-02-25 21:58:53
Log in (anonymous is fine) to add a comment.

Attachments: