cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory Leak when using OpenSSL on Win32

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 28 Oct 2008 09:49:15 +0100 (CET)

On Tue, 28 Oct 2008, Claus Höfele wrote:

> I'm using Microsoft's CRT debugging facilities (crtdbg.h) for memory
> leak detection in my application. The debug handler reports two memory
> leaks when using libcurl's global initialisation and clean up:
>
> curl_global_init(CURL_GLOBAL_ALL);
> curl_global_cleanup();

...

> I believe it is an OpenSSL related problem because the memory leak goes away
> when I comment out the call to Curl_ssl_init() in curl_global_init().

That certainly points to OpenSSL, yes.

> I wonder if this is a known problem. My configuration: libcurl 7.19.0,
> OpenSSL 0.9.8i, MS VC++ 2005 SP1

It is known that OpenSSL has had similar problems in the past, but I've not
seen this particular one - and I don't even have that particular OpenSSL
version installed on my own dev box yet.

I would recommend that you either A) don't care that much about this since
init and cleanup should only be called once during your program's lifetime and
thus this leak should not be a problem, or B) you track down what particular
calls within OpenSSL that leaks the memory and figure out if we can do
anything in libcurl to stop it, or if this needs to be fixed within OpenSSL
you have to take it to the openssl devs.

-- 
  / daniel.haxx.se
Received on 2008-10-28