Add CRYPTO_MDEBUG_ABORT to abort() is there are any memory leaks. This will
authorDr. Stephen Henson <steve@openssl.org>
Sun, 11 Jan 2009 20:36:50 +0000 (20:36 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 11 Jan 2009 20:36:50 +0000 (20:36 +0000)
cause "make test" failures and make resource leaks more obvious.

Configure
crypto/mem_dbg.c

index 535b201f1ab35bcddfe7a83fbbc415602ff85a50..01713b65abd49f207d61dc9de0d5eca3f763f20a 100755 (executable)
--- 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";
 
index 131669a23b2fb4a30e310a73e63d9d7acef9dc34..139cfe1794a6bf6949b182f83581691a0f761742 100644 (file)
@@ -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
                {