This fixes "Spurious test failures on IRIX?" reported in April. Apparently
[openssl.git] / ssl / ssltest.c
index cbcb00c89b1ec4daf792862050a2bb2bd8b06c89..a19f70380cb762f62f4c6a19ffef521522d65a54 100644 (file)
 #include <string.h>
 #include <time.h>
 
-#include "openssl/e_os.h"
+#include "e_os.h"
 
 #include <openssl/bio.h>
 #include <openssl/crypto.h>
@@ -353,6 +353,12 @@ int main(int argc, char *argv[])
        
        CRYPTO_set_locking_callback(lock_dbg_cb);
 
+       /* 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);
 
        RAND_seed(rnd_seed, sizeof rnd_seed);