Stop library before checking for mem leaks
[openssl.git] / crypto / mem_dbg.c
index 0559044..c3d98ca 100644 (file)
@@ -639,6 +639,9 @@ int CRYPTO_mem_leaks(BIO *b)
     if (mh == NULL && amih == NULL)
         return 1;
 
     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;
     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
 
     ml.bio = b;