summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-01-11 20:36:50 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-01-11 20:36:50 +0000
commit8e6925b0cd0ece649fe6b83268528cf8c17adf41 (patch)
treedf12b5791e1457ab8319eb4f3560665af6c869e5
parentd7ecd42255574b775104a7610164a29c1ebfe47f (diff)
Add CRYPTO_MDEBUG_ABORT to abort() is there are any memory leaks. This will
cause "make test" failures and make resource leaks more obvious.
-rwxr-xr-xConfigure2
-rw-r--r--crypto/mem_dbg.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/Configure b/Configure
index 535b201f1a..01713b65ab 100755
--- a/Configure
+++ b/Configure
@@ -102,7 +102,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [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
{