Hi!
I have the problem, that I get a pair of 12 bytes and 396 bytes memory leak
for every connection even if they are closed successfully.
They look like this:
{57741} normal block at 0x035EB310, 12 bytes long.
 Data: <@ n      3  > 40 16 6E 03 00 00 00 00 F0 33 01 00 
{57740} normal block at 0x036E1640, 396 bytes long.
 Data: <                > B0 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

For 126 connections I get 252 of this leaks.

After creating a socket I create a BIO and SSL handle like this:

m_pSSLCommand = SSL_new(m_pCTX);  
m_pBIOCommand = BIO_new_socket((int)m_SockCommand, BIO_NOCLOSE);
SSL_set_bio(m_pSSLCommand, m_pBIOCommand, m_pBIOCommand);

and initialize a handshake with: 
SSL_accept(m_pSSLCommand);

When closing the connection I call:
SSL_shutdown(m_pSSLCommand);
SSL_free(m_pSSLCommand);
closesocket(m_SockCommand);

I saw, that some other have the same problem, but I didn't find any
solution. Has anybody an idea why these leaks occurr?


regards
Alex


P.S.: For the creation of the CTX I reference to a certificate which is used
for handshake, maybe this has some influence:

SSL_library_init();
meth = SSLv23_method(); 
ctx = SSL_CTX_new(meth);
/* Set up a callback for each state change so we can see what's going on */
SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
/* Load our keys and certificates*/
SSL_CTX_use_certificate_chain_file(ctx, pchKeyFile);

SSL_CTX_set_default_passwd_cb(ctx, password_cb);
if(!(SSL_CTX_use_PrivateKey_file(ctx, pchKeyFile, SSL_FILETYPE_PEM))) {
        return(ERROR);
}
/*Make sure the key and certificate file match*/
if (!SSL_CTX_check_private_key(ctx)) {
        return(ERROR);
}





-- 
View this message in context: 
http://www.nabble.com/Memory-Leaks-on-every-connection-tp22805904p22805904.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to