summaryrefslogtreecommitdiffstats
path: root/crypto/mem_dbg.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2001-08-28 15:54:57 +0000
committerGeoff Thorpe <geoff@openssl.org>2001-08-28 15:54:57 +0000
commit3ae34e3a8c2e8902eb42b61a9554f4e988553fbb (patch)
treefcbb9b7bf141dc8e0f118834a9fdd130a08cad47 /crypto/mem_dbg.c
parent1f3b65801b1b0bf11e18c318f7b2c6fcd357e3aa (diff)
Ensure that failure to create the BIO in 'CRYPTO_mem_leaks_fp' doesn't
leave memory debugging turned off. [Spotted by Götz Babin-Ebell]
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r--crypto/mem_dbg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index ed28233071..1c4e04f51f 100644
--- a/crypto/mem_dbg.c
+++ b/crypto/mem_dbg.c
@@ -741,9 +741,9 @@ void CRYPTO_mem_leaks_fp(FILE *fp)
* as we're creating them at a time when we're trying to check we've not
* left anything un-free()'d!! */
MemCheck_off();
- if ((b=BIO_new(BIO_s_file())) == NULL)
- return;
+ b = BIO_new(BIO_s_file());
MemCheck_on();
+ if(!b) return;
BIO_set_fp(b,fp,BIO_NOCLOSE);
CRYPTO_mem_leaks(b);
BIO_free(b);