summaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-12-16 23:02:47 -0500
committerRich Salz <rsalz@openssl.org>2015-12-22 09:11:07 -0500
commit4fae386cb0563a0c05c2817a5ccb3c18e6d62d8d (patch)
treebe4d48641c4e87ab56a24df3e4c4f937c9bb2c34 /crypto/asn1
parentc99de0533debc8a6ed08b47b414bdea19457eafd (diff)
Cleanup CRYPTO_{push,pop}_info
Rename to OPENSSL_mem_debug_{push,pop}. Remove simple calls; keep only calls used in recursive functions. Ensure we always push, to simplify so that we can always pop Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/tasn_new.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c
index 668f6419d1..9362ca2662 100644
--- a/crypto/asn1/tasn_new.c
+++ b/crypto/asn1/tasn_new.c
@@ -103,8 +103,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
asn1_cb = 0;
#ifdef CRYPTO_MDEBUG
- if (it->sname)
- CRYPTO_push_info(it->sname);
+ OPENSSL_mem_debug_push(it->sname ? it->sname : "asn1_item_embed_new");
#endif
switch (it->itype) {
@@ -137,8 +136,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
goto auxerr;
if (i == 2) {
#ifdef CRYPTO_MDEBUG
- if (it->sname)
- CRYPTO_pop_info();
+ OPENSSL_mem_debug_pop();
#endif
return 1;
}
@@ -163,8 +161,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
goto auxerr;
if (i == 2) {
#ifdef CRYPTO_MDEBUG
- if (it->sname)
- CRYPTO_pop_info();
+ OPENSSL_mem_debug_pop();
#endif
return 1;
}
@@ -188,16 +185,14 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
break;
}
#ifdef CRYPTO_MDEBUG
- if (it->sname)
- CRYPTO_pop_info();
+ OPENSSL_mem_debug_pop();
#endif
return 1;
memerr:
ASN1err(ASN1_F_ASN1_ITEM_EMBED_NEW, ERR_R_MALLOC_FAILURE);
#ifdef CRYPTO_MDEBUG
- if (it->sname)
- CRYPTO_pop_info();
+ OPENSSL_mem_debug_pop();
#endif
return 0;
@@ -205,8 +200,7 @@ int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
ASN1err(ASN1_F_ASN1_ITEM_EMBED_NEW, ASN1_R_AUX_ERROR);
ASN1_item_ex_free(pval, it);
#ifdef CRYPTO_MDEBUG
- if (it->sname)
- CRYPTO_pop_info();
+ OPENSSL_mem_debug_pop();
#endif
return 0;
@@ -266,8 +260,8 @@ static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
return 1;
}
#ifdef CRYPTO_MDEBUG
- if (tt->field_name)
- CRYPTO_push_info(tt->field_name);
+ OPENSSL_mem_debug_push(tt->field_name
+ ? tt->field_name : "asn1_template_new");
#endif
/* If SET OF or SEQUENCE OF, its a STACK */
if (tt->flags & ASN1_TFLG_SK_MASK) {
@@ -286,8 +280,7 @@ static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
ret = asn1_item_embed_new(pval, it, embed);
done:
#ifdef CRYPTO_MDEBUG
- if (it->sname)
- CRYPTO_pop_info();
+ OPENSSL_mem_debug_pop();
#endif
return ret;
}