cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Re: libcurl memleak

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 4 Nov 2002 16:54:15 +0100 (MET)

On Fri, 1 Nov 2002, Avery Fay wrote:

> #if 0'ing out that bit of code seems to break something else. When I set
> CURLOPT_INTERFACE to another IP, all connections fail whereas before when
> the leaking code was there they all succeeded. Below is a sample backtrace
> (note that a low number of threads just cause all connections to fail and a
> high number of threads cause all connections to fail + crash):

*ump*

Ok, browsing the code for the CURLOPT_INTERFACE local-bind stuff reveals that
we resolve the IP and there we clear all "outdated" cache entries first, so
when we continue to use the same struct after the local-bind, it has been
free()ed already... :-O

Having identified the error unfortunatately doesn't mean I've yet thought out
a fix. I'm thinking of finally adding some kind of method to mark DNS cache
entries as 'in use' to prevent things like this.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
Received on 2002-11-04