Kill memory debug calls that are now noops. While here, nuke an #if 0 and
authorjsing <jsing@openbsd.org>
Mon, 5 May 2014 16:08:15 +0000 (16:08 +0000)
committerjsing <jsing@openbsd.org>
Mon, 5 May 2014 16:08:15 +0000 (16:08 +0000)
a unnecessary NULL check before free.

ok miod@

lib/libssl/src/apps/openssl.c

index a7d1c9b..1dbc7f4 100644 (file)
@@ -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;