Hi fellow developers,

I have been trying to track down a memory leak in my spop3 client
and have narrowed it down to the following KISS code:

==================================================
// KISS-test

// Initialize OpenSSL
  SSL_library_init();
  RAND_screen();
  SSL_load_error_strings();

  // The next  lines leak
    SSL_CTX * m_ctx = SSL_CTX_new (SSLv2_client_method());
    _ASSERT(m_ctx); 
    SSL_CTX_free (m_ctx);

// Cleanup OpenSSL
 ERR_remove_state(0);
 EVP_cleanup();
 ERR_free_strings();

======================================================
Detected memory leaks!
Dumping objects ->
{1407} normal block at 0x00A768E0, 20 bytes long.
 Data: <     WM         > 00 00 00 00 A8 57 4D 00 00 00 00 00 00 00 00 00
{1406} normal block at 0x00A76920, 16 bytes long.
 Data: < h              > E0 68 A7 00 00 00 00 00 00 00 00 00 00 00 00 00
{1405} normal block at 0x00A76960, 20 bytes long.
 Data: <     i          > 01 00 00 00 20 69 A7 00 00 00 00 00 04 00 00 00
Object dump complete.
=======================================================

If I remove the calls to SSL_CTX_new() and SSL_CTX_free() the leak
disappeers. Putting the 2 lines in a loop and calling it, say, 10 times,
doesn't increase the leak. Am I missing something?

BTW: OpenSSL Version 0.9.5.a with MS VC++ 6.0 SP4

tia,
  Martin


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

Reply via email to