From: Dr. Stephen Henson Date: Thu, 2 Mar 2000 00:37:53 +0000 (+0000) Subject: Fix bug which would free up a public key X-Git-Tag: OpenSSL_0_9_5a-beta1~125 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=582e5929243183b8ba21514b7c198d70359e4734 Fix bug which would free up a public key twice if the verify callback tried to continue after a signature failure. --- diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 4fdff54124..8563f65695 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -436,11 +436,14 @@ static int internal_verify(X509_STORE_CTX *ctx) } if (X509_verify(xs,pkey) <= 0) { - EVP_PKEY_free(pkey); ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE; ctx->current_cert=xs; ok=(*cb)(0,ctx); - if (!ok) goto end; + if (!ok) + { + EVP_PKEY_free(pkey); + goto end; + } } EVP_PKEY_free(pkey); pkey=NULL;