summaryrefslogtreecommitdiffstats
path: root/apps/openssl.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2002-11-18 13:37:40 +0000
committerBodo Möller <bodo@openssl.org>2002-11-18 13:37:40 +0000
commit055076cd4f53849996d90cce60f5ab681b1ba0a6 (patch)
treea764956a071d7fa4bc043b0c3d4861fcfa65461d /apps/openssl.c
parent527497a7224644ab3dfb11a7ee6c3baf570092e6 (diff)
allocate bio_err before memory debugging is enabled to avoid memory leaks
(we can't release it before the CRYPTO_mem_leaks() call!) Submitted by: Nils Larsch
Diffstat (limited to 'apps/openssl.c')
-rw-r--r--apps/openssl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/openssl.c b/apps/openssl.c
index 895d8f76b2..45f8d7f4ef 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -229,6 +229,10 @@ int main(int Argc, char *Argv[])
arg.data=NULL;
arg.count=0;
+ if (bio_err == NULL)
+ 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")))
@@ -253,10 +257,6 @@ int main(int Argc, char *Argv[])
apps_startup();
- if (bio_err == NULL)
- if ((bio_err=BIO_new(BIO_s_file())) != NULL)
- BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
-
/* Lets load up our environment a little */
p=getenv("OPENSSL_CONF");
if (p == NULL)