summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_fetch.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-06-28 14:29:34 +0100
committerMatt Caswell <matt@openssl.org>2019-07-01 10:07:52 +0100
commit08607613d573de9e3e021227506759f4f58debc6 (patch)
tree8bed3e3a143a12e1ba99115cf7cc1a57fd257869 /crypto/evp/evp_fetch.c
parent68756b12f55cb23536d531695619ad4a567916ab (diff)
Only cache a method if we actually created one
We were attempting to cache a method after we failed to create it which leads to an assertion failure. Fixes #9264 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9269)
Diffstat (limited to 'crypto/evp/evp_fetch.c')
-rw-r--r--crypto/evp/evp_fetch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index b039cc0547..e785474372 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -207,7 +207,7 @@ void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
mcmdata.destruct_method = free_method;
if ((method = ossl_method_construct(libctx, operation_id, name,
properties, 0 /* !force_cache */,
- &mcm, &mcmdata)) == NULL) {
+ &mcm, &mcmdata)) != NULL) {
/*
* If construction did create a method for us, we know that
* there is a correct nameid and methodid, since those have