On Nov 7, 2009, at 2:50 PM, barcaroller wrote:
I'm getting some memory leaks when I use OpenSSL. I was not able to get rid of these leaks, even when I use EVP_cleanup() and ERR_free_strings() at the
end of my program.
[....]

==27769== 24 bytes in 1 blocks are still reachable in loss record 2 of 20

I'm guessing these are all ENGINEs which were lazily created the first time they were needed. Notice that they're "still reachable", so they're not necessarily leaks in the usual sense. Have you tried calling ENGINE_cleanup()?

The apps.h header in the openssl distribution has a macro which uses this sequence for shutdown:

  CONF_modules_unload(1);
  EVP_cleanup();
  ENGINE_cleanup();
  CRYPTO_cleanup_all_ex_data();
  ERR_remove_state(0);
  ERR_free_strings();

Other cleanup methods include:

  OBJ_cleanup();
  COMP_zlib_cleanup();
  RAND_cleanup();

....but I'm rather unclear on which need to be called.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to