Good day,

can somebody please say me, how to cleanup OpenSSL_add_all_algorithms()?

I have a constant memory leak with the code in the attatchment.
The valgrind log is also there.


My secound problem:
==32205== Conditional jump or move depends on uninitialised value(s)
==32205==    at 0x51424D9: BN_bin2bn (in /usr/lib/libcrypto.so.1.0.0)

Is there an ability the mute valgrind for those functions?

Sincerely yours

#include <openssl/bio.h>
#include <openssl/ssl.h> 
#include <openssl/err.h> 
#include <openssl/conf.h>
#include <openssl/engine.h>


int main(int argc, char** argv) {
	OpenSSL_add_all_algorithms();
	
	ERR_remove_state(0);
	ERR_free_strings();
	
	ENGINE_cleanup();

	EVP_cleanup();

	sk_SSL_COMP_free( SSL_COMP_get_compression_methods() );

	CONF_modules_finish();
	CONF_modules_free();
	CONF_modules_unload(1);
	
	CRYPTO_cleanup_all_ex_data();

	return 0;
}







==27657== Memcheck, a memory error detector
==27657== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==27657== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==27657== Command: ./a.out
==27657== 
==27657== 
==27657== HEAP SUMMARY:
==27657==     in use at exit: 24 bytes in 1 blocks
==27657==   total heap usage: 546 allocs, 545 frees, 17,408 bytes allocated
==27657== 
==27657== 24 bytes in 1 blocks are definitely lost in loss record 1 of 1
==27657==    at 0x4C28730: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27657==    by 0x5103E92: CRYPTO_malloc (in /usr/lib/libcrypto.so.1.0.0)
==27657==    by 0x4E7E704: SSL_COMP_get_compression_methods (in 
/usr/lib/libssl.so.1.0.0)
==27657==    by 0x400A0E: main (in 
/home/simon/Desktop/y/server/inotify/fertig/a.out)
==27657== 
==27657== LEAK SUMMARY:
==27657==    definitely lost: 24 bytes in 1 blocks
==27657==    indirectly lost: 0 bytes in 0 blocks
==27657==      possibly lost: 0 bytes in 0 blocks
==27657==    still reachable: 0 bytes in 0 blocks
==27657==         suppressed: 0 bytes in 0 blocks
==27657== 
==27657== For counts of detected and suppressed errors, rerun with: -v
==27657== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 1 from 1)

Reply via email to