OPENSSL_cleanup: cleanup secure memory
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Mon, 12 Feb 2018 01:37:27 +0000 (02:37 +0100)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Tue, 13 Feb 2018 16:32:54 +0000 (17:32 +0100)
commitd7c402c4f2d9c311a91616fd75c24a15afabe2e5
treeb9844678e0fac8f2ab3836091ed00017074ff37a
parent8164d91d1802e6173291dee50923cc60fcd3bf72
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)
crypto/init.c