summaryrefslogtreecommitdiffstats
path: root/crypto/mem.c
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2016-01-10 14:42:10 -0500
committerDr. Stephen Henson <steve@openssl.org>2016-01-11 02:41:16 +0000
commitc2e27310c790c0dd2f87dd420e65e0cca522ddb2 (patch)
treebda08e77fcbd3f993498ef5a4c7d9b551b0b47ed /crypto/mem.c
parent3af45d9978c0bf6ce333e9666f41a03d41822d0c (diff)
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.c')
-rw-r--r--crypto/mem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/mem.c b/crypto/mem.c
index ec9efea716..096b1919b7 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -74,7 +74,7 @@ static void *(*realloc_wrapper)(void *, size_t, const char *, int)
static void (*free_wrapper)(void *)
= CRYPTO_free;
-#ifdef CRYPTO_MDEBUG
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
static int call_malloc_debug = 1;
#else
static int call_malloc_debug = 0;
@@ -125,7 +125,7 @@ void *CRYPTO_malloc(size_t num, const char *file, int line)
return NULL;
allow_customize = 0;
-#ifdef CRYPTO_MDEBUG
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
if (call_malloc_debug) {
CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);
ret = malloc(num);
@@ -174,7 +174,7 @@ void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
}
allow_customize = 0;
-#ifdef CRYPTO_MDEBUG
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
if (call_malloc_debug) {
void *ret;
CRYPTO_mem_debug_realloc(str, NULL, num, 0, file, line);
@@ -211,7 +211,7 @@ void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,
/* Allocate new memory. Call malloc and do a copy, so that we can
* cleanse the old buffer. */
-#ifdef CRYPTO_MDEBUG
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
if (call_malloc_debug) {
CRYPTO_mem_debug_realloc(str, NULL, num, 0, file, line);
ret = malloc(num);
@@ -233,7 +233,7 @@ void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,
void CRYPTO_free(void *str)
{
-#ifdef CRYPTO_MDEBUG
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
if (call_malloc_debug) {
CRYPTO_mem_debug_free(str, 0);
free(str);