OPENSSL_cleanup: cleanup secure memory

If the global DRBGs are allocated on the secure heap, then calling
CRYPTO_secure_malloc_done() inside main() will have no effect, unless
OPENSSL_cleanup() has been called explicitely before that, because
otherwise the DRBGs will still be allocated. So it is better to cleanup
the secure heap automatically at the end of OPENSSL_cleanup().

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5294)
This commit is contained in:
Dr. Matthias St. Pierre 2018-02-12 02:37:27 +01:00
parent 8164d91d18
commit d7c402c4f2

View File

@ -502,6 +502,8 @@ void OPENSSL_cleanup(void)
obj_cleanup_int();
err_cleanup();
CRYPTO_secure_malloc_done();
base_inited = 0;
}