Forcibly enable memory leak checking during "make test"
diff --git a/crypto/dsa/dsatest.c b/crypto/dsa/dsatest.c
index fdac632..9eea866 100644
--- a/crypto/dsa/dsatest.c
+++ b/crypto/dsa/dsatest.c
@@ -142,6 +142,8 @@
 	if (bio_err == NULL)
 		bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 
+	CRYPTO_malloc_debug_init();
+	CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
 	CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 
 	BIO_printf(bio_err,"test generation of DSA parameters\n");
diff --git a/crypto/ec/ectest.c b/crypto/ec/ectest.c
index 82df606..ac0f055 100644
--- a/crypto/ec/ectest.c
+++ b/crypto/ec/ectest.c
@@ -149,6 +149,12 @@
 	unsigned char buf[100];
 	size_t i, len;
 	
+	/* enable memory leak checking unless explicitly disabled */
+	if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off"))))
+		{
+		CRYPTO_malloc_debug_init();
+		CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
+		}
 	CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 	ERR_load_crypto_strings();
 
diff --git a/crypto/rsa/rsa_test.c b/crypto/rsa/rsa_test.c
index e882b5b..2c0a1d5 100644
--- a/crypto/rsa/rsa_test.c
+++ b/crypto/rsa/rsa_test.c
@@ -221,6 +221,8 @@
 
     RAND_seed(rnd_seed, sizeof rnd_seed); /* or OAEP may fail */
 
+    CRYPTO_malloc_debug_init();
+    CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 	
     plen = sizeof(ptext_ex) - 1;