cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leak in libcurl

From: Ragnar Lonn <ragnar_at_gatorhole.com>
Date: Tue, 06 Jan 2009 01:36:46 +0100

Huzaifa Al Nahas wrote:
> 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?
>

I'm fairly new to libcurl, but it would seem very strange if you as a
user had to call ENGINE_free() to clean up after libcurl's SSL engine. A
quick look at the source shows also that libcurl does call
ENGINE_free(), so I don't think it is something the libcurl user has to
bother with. I think you're on the wrong track, but if you suspect that
ENGINE_free() is not called, run it in a debugger and see what happens.

raglon_at_snik1:~/curl-7.19.2$ grep ENGINE_free lib/*.c
lib/ssluse.c: ENGINE_free(data->state.engine);
lib/ssluse.c: ENGINE_free(e);
lib/ssluse.c: ENGINE_free(data->state.engine);

  /Ragnar
Received on 2009-01-06