diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-02-08 13:14:05 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-02-09 13:01:28 +0000 |
commit | 66aacf387224e8977d8214437939227d7e0c91d8 (patch) | |
tree | fb8eef6150e3a7337c2db1977112c73a3b6b3d88 /apps/openssl.c | |
parent | 97ac0d8564f5b8f9be7905c2cd60d9c6f8efc1f1 (diff) |
Fix memory leak reporting.
Free up bio_err after memory leak data has been printed to it.
In int_free_ex_data if ex_data is NULL there is nothing to free up
so return immediately and don't reallocate it.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 9c7a780bbebc1b6d87dc38a6aa3339033911a8bb)
Diffstat (limited to 'apps/openssl.c')
-rw-r--r-- | apps/openssl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/openssl.c b/apps/openssl.c index 112ed7e602..6873145223 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -428,10 +428,6 @@ int main(int Argc, char *ARGV[]) if (arg.data != NULL) OPENSSL_free(arg.data); - if (bio_err != NULL) { - BIO_free(bio_err); - bio_err = NULL; - } #if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64) /* Free any duplicate Argv[] storage. */ if (free_Argv) { @@ -440,6 +436,10 @@ int main(int Argc, char *ARGV[]) #endif apps_shutdown(); CRYPTO_mem_leaks(bio_err); + if (bio_err != NULL) { + BIO_free(bio_err); + bio_err = NULL; + } OPENSSL_EXIT(ret); } |