This commits changes to various parts of libcrypto required by the recent
[openssl.git] / crypto / dh / dhtest.c
index e90f255f6c890c5e7968da88e03a0357b43fca3e..0176436a55026b5305d269192c15c8ea6ce3213b 100644 (file)
@@ -66,6 +66,7 @@
 #include <openssl/bio.h>
 #include <openssl/bn.h>
 #include <openssl/rand.h>
+#include <openssl/err.h>
 
 #ifdef OPENSSL_NO_DH
 int main(int argc, char *argv[])
@@ -99,6 +100,10 @@ int main(int argc, char *argv[])
        int i,alen,blen,aout,bout,ret=1;
        BIO *out;
 
+       CRYPTO_malloc_debug_init();
+       CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
+       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
+
 #ifdef OPENSSL_SYS_WIN32
        CRYPTO_malloc_init();
 #endif
@@ -175,6 +180,9 @@ err:
        if(b != NULL) DH_free(b);
        if(a != NULL) DH_free(a);
        BIO_free(out);
+       CRYPTO_cleanup_all_ex_data();
+       ERR_remove_state(0);
+       CRYPTO_mem_leaks_fp(stderr);
        exit(ret);
        return(ret);
        }