::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.