From 8e6925b0cd0ece649fe6b83268528cf8c17adf41 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 11 Jan 2009 20:36:50 +0000 Subject: [PATCH] Add CRYPTO_MDEBUG_ABORT to abort() is there are any memory leaks. This will cause "make test" failures and make resource leaks more obvious. --- Configure | 2 +- crypto/mem_dbg.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Configure b/Configure index 535b201f1a..01713b65ab 100755 --- a/Configure +++ b/Configure @@ -102,7 +102,7 @@ my $usage="Usage: Configure [no- ...] [enable- ...] [experimenta # Minimum warning options... any contributions to OpenSSL should at least get # past these. -my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DREF_CHECK -DOPENSSL_NO_DEPRECATED"; +my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED"; my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index 131669a23b..139cfe1794 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -772,6 +772,9 @@ void CRYPTO_mem_leaks(BIO *b) { BIO_printf(b,"%ld bytes leaked in %d chunks\n", ml.bytes,ml.chunks); +#ifdef CRYPTO_MDEBUG_ABORT + abort(); +#endif } else { -- 2.25.1