cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leak when using OpenSSL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 19 Aug 2003 09:53:10 +0200 (CEST)

On Mon, 18 Aug 2003, Loren Kirkby wrote:

> I'm using libcurl+OpenSSL in my application to do HTTPS transfers.
> Everything is working great, but when my application shuts down, the MSVC++
> memory tracker says that OpenSSL is leaking memory. After looking at the
> sample OpenSSL applications (e.g. ssltest.c), it seems that
> CRYPTO_cleanup_all_ex_data() is needed when shutting down. Adding this call
> to Curl_SSL_cleanup() fixes the memory leaks. Is there a reason
> CRYPTO_cleanup_all_ex_data() isn't being called?

Yes, there is a reason: I've never read anything anywhere about us having to
call that function. :-(

Coding with OpenSSL is mainly done by guessing, as the docs leave out most of
the details you'd want to learn...

> BTW, Thanks for a fantastic library!

Thanks for pointing out this flaw. This is now corrected in CVS.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-19