Fix memory leak in the apps
The BIO_free() allocated ex_data again that we already freed.
Reviewed-by: Richard Levitte <levitte@openssl.org>
diff --git a/apps/openssl.c b/apps/openssl.c
index 71e1e48..5372459 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -435,9 +435,7 @@
if (prog != NULL) lh_FUNCTION_free(prog);
if (arg.data != NULL) OPENSSL_free(arg.data);
- apps_shutdown();
- CRYPTO_mem_leaks(bio_err);
if (bio_err != NULL)
{
BIO_free(bio_err);
@@ -450,6 +448,9 @@
OPENSSL_free(Argv);
}
#endif
+ apps_shutdown();
+ CRYPTO_mem_leaks(bio_err);
+
OPENSSL_EXIT(ret);
}