[openssl-dev] [libcrypto EVP] valgrind reports many memory leaks in wiki-example

U.Mutlu for-gmane at mutluit.com
Tue Nov 24 19:42:27 UTC 2015


Salz, Rich wrote on 11/24/2015 06:37 PM:
>>> Attached is the valgrind-output. It says:
>>>     34 not-freed blocks
>
> The sample program doesn't clean up everything.  Look at the function apps_shutdown in apps/openssl.c (in master)

Ok, thx. After the following additions to the said sample the mem-leaks disappear:

#include <openssl/engine.h>

// extracted from the macro "apps_shutdown()" in file openssl/apps apps.h
void my_libcrypto_shutdown()
   {
     CONF_modules_unload(1);
     EVP_cleanup();
     ENGINE_cleanup();
     CRYPTO_cleanup_all_ex_data();
     ERR_remove_state(0);
     ERR_free_strings();
   }

// at the end of the app call this:
my_libcrypto_shutdown();


-- 
U.Mutlu




More information about the openssl-dev mailing list