summaryrefslogtreecommitdiffstats
path: root/crypto/init.c
diff options
context:
space:
mode:
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-02-12 02:37:27 +0100
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-02-13 17:32:54 +0100
commitd7c402c4f2d9c311a91616fd75c24a15afabe2e5 (patch)
treeb9844678e0fac8f2ab3836091ed00017074ff37a /crypto/init.c
parent8164d91d1802e6173291dee50923cc60fcd3bf72 (diff)
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)
Diffstat (limited to 'crypto/init.c')
-rw-r--r--crypto/init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/init.c b/crypto/init.c
index 1b94d07e04..4a88e9cc02 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -502,6 +502,8 @@ void OPENSSL_cleanup(void)
obj_cleanup_int();
err_cleanup();
+ CRYPTO_secure_malloc_done();
+
base_inited = 0;
}