summaryrefslogtreecommitdiffstats
path: root/test/ssltest.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/ssltest.c')
-rw-r--r--test/ssltest.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/ssltest.c b/test/ssltest.c
index 44d001965e..c3d655e36f 100644
--- a/test/ssltest.c
+++ b/test/ssltest.c
@@ -1009,6 +1009,7 @@ int main(int argc, char *argv[])
int server_auth = 0, i;
struct app_verify_arg app_verify_arg =
{ APP_CALLBACK_STRING, 0, 0, NULL, NULL };
+ char *p;
#ifndef OPENSSL_NO_EC
char *named_curve = NULL;
#endif
@@ -1059,15 +1060,9 @@ 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_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
- } else {
- /* OPENSSL_DEBUG_MEMORY=off */
- CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);
- }
+ p = getenv("OPENSSL_DEBUG_MEMORY");
+ if (p != NULL && strcmp(p, "on") == 0)
+ CRYPTO_set_mem_debug(1);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
RAND_seed(rnd_seed, sizeof rnd_seed);
@@ -1826,7 +1821,9 @@ int main(int argc, char *argv[])
ERR_free_strings();
ERR_remove_thread_state(NULL);
EVP_cleanup();
+#ifdef CRYPTO_MDEBUG
CRYPTO_mem_leaks(bio_err);
+#endif
BIO_free(bio_err);
EXIT(ret);
}