summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-07-10 12:24:25 +0000
committertedu <tedu@openbsd.org>2014-07-10 12:24:25 +0000
commita2230efbc04eaf8ac2fd63bd05729243146e4f07 (patch)
tree967966d2d66d54f8c8a2d4db7191f16a9a00bf6a /lib/libcrypto
parentStop using a shutdown hook for softraid(4) and explicitly shutdown (diff)
downloadwireguard-openbsd-a2230efbc04eaf8ac2fd63bd05729243146e4f07.tar.xz
wireguard-openbsd-a2230efbc04eaf8ac2fd63bd05729243146e4f07.zip
make asn1 free safe to call with null pointers of any type.
ok jsing miod
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/asn1/tasn_fre.c7
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