Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-11-02
00:05 • Closed ticket [477198ffff]: ::http::geturl leaks memory on Win32 plus 7 othe... artifact: 421c371a69 user: hobbs
00:00 • Ticket [477198ffff]: 4 changes artifact: c05d1ffe71 user: nobody
2001-11-01
16:56 • New ticket [477198ffff]. artifact: 153b811f9e user: nobody

::http::geturl leaks memory on Win32

Closed / Invalid477198ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-11-01 16:56:59
It seems that the ::http::geturl command leaks memory
in the Win32 version of TCL 8.3.4. This was not the
case in TCL 8.3.3. The attached file shows this
behavior; source it in tclsh83 and observe the memory
allocation grow in Task Manager.
nobodyplain2001-11-02 00:00:47
Logged In: NO 

Seems like the file upload didn't take. Since the example is
fairly short, I'm attaching it here. Commenting out the
geturl call results in no memory being leaked.

package require http

::http::config -useragent "Mozilla/5.0 (Windows; U;
WinNT4.0; en-US; rv:0.9.5) Gecko/20011011"

set url "http://www.usps.gov/cgi-bin/zip4/ctystzip2"

set zip 1000
while { $zip < 100000 } {
set zipcode $zip
if { [string length $zipcode] < 5 } { set zipcode "0$zipcode" }
puts "$zipcode"

set query [::http::formatQuery ctystzip $zipcode]
set http  [::http::geturl $url -query $query]

incr zip
}
hobbsplain2001-11-02 00:05:47
Logged In: YES 
user_id=72656

Please note that ::http::geturl requires that the returned 
token is eventually freed with ::http::cleanup (when you no 
longer need that information about the connection).  This 
is in the docs.
Log in (anonymous is fine) to add a comment.