diff options
author | 2015-07-20 15:29:13 +0000 | |
---|---|---|
committer | 2015-07-20 15:29:13 +0000 | |
commit | dc019addd766d21815e66cf7862b8a4f4f34c4ea (patch) | |
tree | cea9d34ddcd49a0658471c58558ea2aa841ddf0d /lib/libssl/src | |
parent | In X509_PKEY_new(), make sure all allocation failures push an error to the (diff) | |
download | wireguard-openbsd-dc019addd766d21815e66cf7862b8a4f4f34c4ea.tar.xz wireguard-openbsd-dc019addd766d21815e66cf7862b8a4f4f34c4ea.zip |
When freeing an X509_CRL, if freeing the user-maintained meth_data fails,
do not forgot to nevertheless keep freeing the other fields.
ok doug@ guenther@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/crypto/asn1/x_crl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libssl/src/crypto/asn1/x_crl.c b/lib/libssl/src/crypto/asn1/x_crl.c index 7b76d2ec47e..6062587ed46 100644 --- a/lib/libssl/src/crypto/asn1/x_crl.c +++ b/lib/libssl/src/crypto/asn1/x_crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_crl.c,v 1.24 2015/02/11 04:00:39 jsing Exp $ */ +/* $OpenBSD: x_crl.c,v 1.25 2015/07/20 15:29:13 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -270,6 +270,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) STACK_OF(X509_EXTENSION) *exts; X509_EXTENSION *ext; int idx; + int rc = 1; switch (operation) { case ASN1_OP_NEW_POST: @@ -345,7 +346,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) case ASN1_OP_FREE_POST: if (crl->meth->crl_free) { if (!crl->meth->crl_free(crl)) - return 0; + rc = 0; } if (crl->akid) AUTHORITY_KEYID_free(crl->akid); @@ -356,7 +357,7 @@ crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); break; } - return 1; + return rc; } /* Convert IDP into a more convenient form */ |