diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-07-10 12:24:26 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-07-10 12:24:26 +0000 |
commit | a640d4127718b48bc1841475bee7c54f3febb5d3 (patch) | |
tree | c2239503f118acd928780c4b320b69767bae17ff /lib/libcrypto/asn1 | |
parent | 15472e31c60594ba5e8f2b2619f056470c3b11fc (diff) |
make asn1 free safe to call with null pointers of any type.
ok jsing miod
Diffstat (limited to 'lib/libcrypto/asn1')
-rw-r--r-- | lib/libcrypto/asn1/tasn_fre.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libcrypto/asn1/tasn_fre.c b/lib/libcrypto/asn1/tasn_fre.c index 0369bf23399..d8d55a536ca 100644 --- a/lib/libcrypto/asn1/tasn_fre.c +++ b/lib/libcrypto/asn1/tasn_fre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_fre.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: tasn_fre.c,v 1.12 2014/07/10 12:24:25 tedu Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -89,10 +89,9 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) ASN1_aux_cb *asn1_cb; int i; - if (!pval) - return; - if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval) + if (pval == NULL || *pval == NULL) return; + if (aux && aux->asn1_cb) asn1_cb = aux->asn1_cb; else |