X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fopenssl.c;h=58f8bb73a10fed6c9401de7a10cb42eaee3ae8f7;hp=3b4374a0488dd933482e731fb63a0bb34f8b93a7;hb=336da5642d298499719fbb533d3fd9f72ef7f1f0;hpb=2c7bc88d785b40bd12a5080fc3d2ef9445460079 diff --git a/apps/openssl.c b/apps/openssl.c index 3b4374a048..58f8bb73a1 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -138,7 +138,7 @@ static unsigned long MS_CALLBACK hash(const void *a_void); static int MS_CALLBACK cmp(const void *a_void,const void *b_void); static LHASH *prog_init(void ); static int do_cmd(LHASH *prog,int argc,char *argv[]); -LHASH *config=NULL; +CONF *config=NULL; char *default_config_file=NULL; /* Make sure there is only one when MONOLITH is defined */ @@ -227,12 +227,17 @@ int main(int Argc, char *Argv[]) arg.data=NULL; arg.count=0; - if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) + 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_dbg_set_options(V_CRYPTO_MDEBUG_ALL); + 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); @@ -269,8 +274,9 @@ int main(int Argc, char *Argv[]) default_config_file=p; - config=CONF_load(config,p,&errline); - if (config == NULL) ERR_clear_error(); + config=NCONF_new(NULL); + i=NCONF_load(config,p,&errline); + if (i == 0) ERR_clear_error(); prog=prog_init(); @@ -339,7 +345,7 @@ int main(int Argc, char *Argv[]) end: if (config != NULL) { - CONF_free(config); + NCONF_free(config); config=NULL; } if (prog != NULL) lh_free(prog); @@ -347,10 +353,11 @@ end: ERR_remove_state(0); EVP_cleanup(); + ENGINE_cleanup(); + ERR_free_strings(); - ENGINE_cleanup(); - destroy_ui_method(); + apps_shutdown(); CRYPTO_mem_leaks(bio_err); if (bio_err != NULL)