On Thu, 2 Aug 2001 20:17:52 +0100, "Mike Scriven" <[EMAIL PROTECTED]>
wrote:

>I've written a Windows app. using OpenSSL and I'm getting memory 
>leaks when I close it, even if I haven't connected a socket. 

I'm no expert, but I've been reading the man pages a lot... so here are
my thoughts.

>At startup I do the following:
>
>SSLeay_add_ssl_algorithms();

I think you should be using OpenSSL_add_all_algorithms() here.

>SSL_load_error_strings();
>m_pSSLctx = SSL_CTX_new(SSLv23_client_method());
>
>and at shutdown I do this:
>
>SSL_CTX_free(m_pSSLctx);
>ERR_free_strings();

Looks like you missed EVP_cleanup(). From the
OpenSSL_add_all_algorithms(3) man page:

-----

OpenSSL keeps an internal table of digest algorithms and ciphers. It
uses this table to lookup ciphers via functions such as
EVP_get_cipher_byname(). 

OpenSSL_add_all_digests() adds all digest algorithms to the table. 

OpenSSL_add_all_algorithms() adds all algorithms to the table (digests
and ciphers). 

OpenSSL_add_all_ciphers() adds all encryption algorithms to the table
including password based encryption algorithms. 

EVP_cleanup() removes all ciphers and digests from the table. 

-----

This may solve your problem.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to