cURL / Mailing Lists / curl-library / Single Mail

curl-library

Memory Leak when using OpenSSL on Win32

From: Claus Höfele <claus_at_claushoefele.com>
Date: Tue, 28 Oct 2008 14:12:54 +1100

Hi everyone,

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();

When calling those two functions (no other function from libcurl is
used) and exiting, I receive the following dump:

Detected memory leaks!
Dumping objects ->
{2548} normal block at 0x01207BB8, 16 bytes long.
 Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
{2547} normal block at 0x01207AD0, 20 bytes long.
 Data: < { > 00 00 00 00 B8 7B 20 01 00 00 00 00 04 00 00 00
Object dump complete.

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().

I made sure that I have HAVE_CRYPTO_CLEANUP_ALL_EX_DATA defined, which
was reported as a memory leak in a previous thread.

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

Thanks,
Claus
Received on 2008-10-28