aboutsummaryrefslogtreecommitdiff
path: root/crypto/mem_dbg.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-02-09 22:09:56 +0000
committerMatt Caswell <matt@openssl.org>2016-02-09 23:29:31 +0000
commit38a6d7f89a6d060b7d463cbdd15eada434bb2d69 (patch)
tree29fbd286760addb9d953bd35c9c4c5eff92ddd9b /crypto/mem_dbg.c
parent7839b735d884cfa10d18c39c79fea48b97fcb634 (diff)
downloadopenssl-38a6d7f89a6d060b7d463cbdd15eada434bb2d69.zip
openssl-38a6d7f89a6d060b7d463cbdd15eada434bb2d69.tar.gz
openssl-38a6d7f89a6d060b7d463cbdd15eada434bb2d69.tar.bz2
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 <rsalz@openssl.org>
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r--crypto/mem_dbg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index 0559044..c3d98ca 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;