Hello everyone,

My company has been working on an SSL enabled server application, and we have recently encountered a memory leak bug which appears to lead to the eventual crash of the server. We ran a test having a client application do nothing but connect to the server application and close the connection. After about 2,000 connections the server grows by about 50 MB and then it crashes.

I've been doing some research into this and so far the main cause seems to be that we were not calling SSL_free after each connection closed. From what I have gathered, the correct way to cleanup after a connection is to call the following functions in this order:

   SSL_shutdown(ssl);
   SSL_free(ssl);
   close(socket);

My main reason for writing this e-mail is that I wanted to make sure I wasn't missing anything as far as cleaning up after each connection. Are there any other functions I should be calling to prevent memory leaks? I would be grateful to hear from anyone who is experienced in this area. Thank you in advance.

Best Regards,

Jason Resch


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

Reply via email to