From: Geoff Thorpe Date: Tue, 28 Aug 2001 15:54:57 +0000 (+0000) Subject: Ensure that failure to create the BIO in 'CRYPTO_mem_leaks_fp' doesn't X-Git-Tag: OpenSSL_0_9_6c~123^2~48 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3ae34e3a8c2e8902eb42b61a9554f4e988553fbb;p=oweals%2Fopenssl.git 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] --- 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);