Commit d7c402c4 authored by Dr. Matthias St. Pierre's avatar Dr. Matthias St. Pierre
Browse files

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: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5294)
parent 8164d91d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -502,6 +502,8 @@ void OPENSSL_cleanup(void)
    obj_cleanup_int();
    err_cleanup();

    CRYPTO_secure_malloc_done();

    base_inited = 0;
}