summaryrefslogtreecommitdiffstats
path: root/crypto/mem_dbg.c
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2016-01-10 20:42:10 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-01-11 03:41:16 +0100
commitc2e27310c790c0dd2f87dd420e65e0cca522ddb2 (patch)
treebda08e77fcbd3f993498ef5a4c7d9b551b0b47ed /crypto/mem_dbg.c
parentDisable some algorithms by default (diff)
downloadopenssl-c2e27310c790c0dd2f87dd420e65e0cca522ddb2.tar.xz
openssl-c2e27310c790c0dd2f87dd420e65e0cca522ddb2.zip
Enable/disable crypto-mdebug just like other features
Also always abort() on leak failure. Reviewed-by: Stephen Henson <steve@openssl.org>
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r--crypto/mem_dbg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index 72487b5e03..1e9dd83c14 100644
--- a/crypto/mem_dbg.c
+++ b/crypto/mem_dbg.c
@@ -132,7 +132,9 @@
* checking temporarily. State CRYPTO_MEM_CHECK_ENABLE without ..._ON makes
* no sense whatsoever.
*/
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
static int mh_mode = CRYPTO_MEM_CHECK_OFF;
+#endif
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
static unsigned long order = 0; /* number of memory requests */
@@ -203,7 +205,7 @@ static void app_info_free(APP_INFO *inf)
int CRYPTO_mem_ctrl(int mode)
{
-#ifndef CRYPTO_MDEBUG
+#ifdef OPENSSL_NO_CRYPTO_MDEBUG
return mode - mode;
#else
int ret = mh_mode;
@@ -663,9 +665,7 @@ void CRYPTO_mem_leaks(BIO *b)
}
if (ml.chunks != 0) {
BIO_printf(b, "%ld bytes leaked in %d chunks\n", ml.bytes, ml.chunks);
-# ifdef CRYPTO_MDEBUG_ABORT
abort();
-# endif
} else {
/*
* Make sure that, if we found no leaks, memory-leak debugging itself