From c70e270c3beae8fee85f323646d4afbb8a12f683 Mon Sep 17 00:00:00 2001 From: jsing Date: Mon, 5 May 2014 16:08:15 +0000 Subject: [PATCH] Kill memory debug calls that are now noops. While here, nuke an #if 0 and a unnecessary NULL check before free. ok miod@ --- lib/libssl/src/apps/openssl.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/lib/libssl/src/apps/openssl.c b/lib/libssl/src/apps/openssl.c index a7d1c9ba06a..1dbc7f464fe 100644 --- a/lib/libssl/src/apps/openssl.c +++ b/lib/libssl/src/apps/openssl.c @@ -256,25 +256,7 @@ main(int argc, char **argv) if ((bio_err = BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT); - if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) { /* if not defined, use - * compiled-in library - * defaults */ - if (!(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); - } - } - CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); - -#if 0 - if (getenv("OPENSSL_DEBUG_LOCKING") != NULL) -#endif - { - CRYPTO_set_locking_callback(lock_dbg_cb); - } + CRYPTO_set_locking_callback(lock_dbg_cb); openssl_startup(); @@ -376,8 +358,8 @@ main(int argc, char **argv) ret = 1; end: - if (to_free) - free(to_free); + free(to_free); + if (config != NULL) { NCONF_free(config); config = NULL; @@ -389,7 +371,6 @@ end: openssl_shutdown(); - CRYPTO_mem_leaks(bio_err); if (bio_err != NULL) { BIO_free(bio_err); bio_err = NULL; -- 2.20.1