diff options
author | miod <> | 2014-06-27 04:41:09 +0000 |
---|---|---|
committer | miod <> | 2014-06-27 04:41:09 +0000 |
commit | 9284be583ffaee688afc6bd5c5b5b23cdf59ea00 (patch) | |
tree | 471008404dddccfd44baa51e2ca76102479c8498 /src/lib/libcrypto/asn1/asn1_mac.h | |
parent | 4716a776432b47e6ff7f013cce20e596507891b9 (diff) | |
download | openbsd-9284be583ffaee688afc6bd5c5b5b23cdf59ea00.tar.gz openbsd-9284be583ffaee688afc6bd5c5b5b23cdf59ea00.tar.bz2 openbsd-9284be583ffaee688afc6bd5c5b5b23cdf59ea00.zip |
Remove M_ASN1_New* macros which are only used in X509_PKEY_new() are obfuscate
it to hide memory leaks in the error paths, and fix aforementioned memory
leaks.
ok jsing@ logan@ deraadt@
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_mac.h')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_mac.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_mac.h b/src/lib/libcrypto/asn1/asn1_mac.h index 9d989eb797..fd524dc21c 100644 --- a/src/lib/libcrypto/asn1/asn1_mac.h +++ b/src/lib/libcrypto/asn1/asn1_mac.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1_mac.h,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: asn1_mac.h,v 1.14 2014/06/27 04:41:09 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -287,21 +287,6 @@ err:\ | |||
287 | c.slen-=(c.p-c.q); \ | 287 | c.slen-=(c.p-c.q); \ |
288 | } | 288 | } |
289 | 289 | ||
290 | /* New macros */ | ||
291 | #define M_ASN1_New_Malloc(ret,type) \ | ||
292 | if ((ret = malloc(sizeof(type))) == NULL) \ | ||
293 | { c.line=__LINE__; goto err2; } | ||
294 | |||
295 | #define M_ASN1_New(arg,func) \ | ||
296 | if (((arg)=func()) == NULL) return(NULL) | ||
297 | |||
298 | #define M_ASN1_New_Error(a) \ | ||
299 | /* err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \ | ||
300 | return(NULL);*/ \ | ||
301 | err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \ | ||
302 | return(NULL) | ||
303 | |||
304 | |||
305 | /* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, | 290 | /* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, |
306 | some macros that use ASN1_const_CTX still insist on writing in the input | 291 | some macros that use ASN1_const_CTX still insist on writing in the input |
307 | stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. | 292 | stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. |