From: Matt Caswell Date: Tue, 9 Feb 2016 22:09:56 +0000 (+0000) Subject: Stop library before checking for mem leaks X-Git-Tag: OpenSSL_1_1_0-pre3~159 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=38a6d7f89a6d060b7d463cbdd15eada434bb2d69;ds=sidebyside Stop library before checking for mem leaks With the new init framework resources aren't released until the process exits. This means checking for mem leaks before that point finds a lot of things! We should explicitly close down the library if we're checking for mem leaks. Reviewed-by: Rich Salz --- diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index 05590442d1..c3d98caec9 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -639,6 +639,9 @@ int CRYPTO_mem_leaks(BIO *b) if (mh == NULL && amih == NULL) return 1; + /* Ensure all resources are released */ + OPENSSL_INIT_library_stop(); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); ml.bio = b;