From c2e27310c790c0dd2f87dd420e65e0cca522ddb2 Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Sun, 10 Jan 2016 14:42:10 -0500 Subject: Enable/disable crypto-mdebug just like other features Also always abort() on leak failure. Reviewed-by: Stephen Henson --- crypto/asn1/tasn_new.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crypto/asn1') diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c index 9362ca2662..125b26fd7f 100644 --- a/crypto/asn1/tasn_new.c +++ b/crypto/asn1/tasn_new.c @@ -102,7 +102,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed) else asn1_cb = 0; -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_push(it->sname ? it->sname : "asn1_item_embed_new"); #endif @@ -135,7 +135,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed) if (!i) goto auxerr; if (i == 2) { -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_pop(); #endif return 1; @@ -160,7 +160,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed) if (!i) goto auxerr; if (i == 2) { -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_pop(); #endif return 1; @@ -184,14 +184,14 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed) goto auxerr; break; } -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_pop(); #endif return 1; memerr: ASN1err(ASN1_F_ASN1_ITEM_EMBED_NEW, ERR_R_MALLOC_FAILURE); -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_pop(); #endif return 0; @@ -199,7 +199,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed) auxerr: ASN1err(ASN1_F_ASN1_ITEM_EMBED_NEW, ASN1_R_AUX_ERROR); ASN1_item_ex_free(pval, it); -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_pop(); #endif return 0; @@ -259,7 +259,7 @@ static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) *pval = NULL; return 1; } -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_push(tt->field_name ? tt->field_name : "asn1_template_new"); #endif @@ -279,7 +279,7 @@ static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) /* Otherwise pass it back to the item routine */ ret = asn1_item_embed_new(pval, it, embed); done: -#ifdef CRYPTO_MDEBUG +#ifndef OPENSSL_NO_CRYPTO_MDEBUG OPENSSL_mem_debug_pop(); #endif return ret; -- cgit v1.2.3