cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leak in libcurl

From: Huzaifa Al Nahas <halnahas_at_gmail.com>
Date: Mon, 5 Jan 2009 15:56:08 -0800

Dan,
After more research, it appears that it is a bug in libcurl design. I
contacted openssl support team and they replied suggesting that the
memory leak can be avoided by using ENGINE_free. However, this
function takes as argument a pointer to the ENGINE that was called in
ENGINE_new. AFAIK libcurl does not give the library user access to
this pointer. What do you think?

Thanks,
Huzaifa

On Mon, Dec 22, 2008 at 5:22 PM, Dan Fandrich <dan_at_coneharvesters.com> wrote:
> On Mon, Dec 22, 2008 at 04:57:15PM -0800, Huzaifa Al Nahas wrote:
>> The idea is perfectly reasonable if the memory was in fact allocated
>> before main. However, it appears that leaked memory is being allocated
>> when curl_easy_init or curl_global_init are called. This is evident
>> because capturing a memory snapshot at the beginning of main and
>> comparing it to a snapshot before exit still reveals a memory leak as
>> the next program illustrates:
>
> If that doesn't even work you should be able to move the
> curl_global_init/cleanup functions outside the memory checking section. If
> there's no function call that OpenSSL exposes to clean up its memory,
> then I don't see what else can be done.
>
>>>> Dan
> --
> http://www.MoveAnnouncer.com The web change of address service
> Let webmasters know that your web site has moved
>
Received on 2009-01-06