cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [patch] libcurl 7.12.2-20040917 and CURLOPT_VERBOSE may read free()ed data

From: Bertrand Demiddelaer <bdemiddelaer_at_denyall.com>
Date: Wed, 29 Sep 2004 10:59:52 +0200

Daniel Stenberg wrote:
> On Mon, 27 Sep 2004, Bertrand Demiddelaer wrote:
>
>> Here's a new fix which works for me, and a test program to run with
>> valgrind...
>
>
> This will leave the entry without unlocking it, thus having the inuse
> counter increased and never decreased again. It will never get pruned.
>
> I believe a better fix is to make the unlock (unconditionally like it is
> currently made in Curl_done()) in the Curl_disconnect() function. We
> want the inuse counter to be zero when nothing uses the dns entry anymore.

Well, I made the unlock conditionnal in Curl_done() but it is the same
condition which triggers the call to Curl_disconnect() in Curl_done().
So, putting an unconditionnal call to unlock in Curl_disconnect() won't
change the behaviour, comparing to my fix. I choosed this way of fixing
libcurl so that it changes less code, and is closer to current libcurl.

As you seem to disagree with this patch, I made tests this morning with
verbosed pruning functions: my entries do get pruned (and they really
get pruned when the socket disconnects).
Received on 2004-09-29