summaryrefslogtreecommitdiff
path: root/crypto/evp/keymgmt_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-10-16 10:22:42 +0200
committerRichard Levitte <levitte@openssl.org>2021-10-16 10:22:42 +0200
commitfb0f65fff831d9294e34b6ef6f579c157db54b04 (patch)
treeb56e169b0c6631becc25df8b84fddb89a6ebbd26 /crypto/evp/keymgmt_lib.c
parentd5d95daba59adc41ab60ea86acd513f255fca3c0 (diff)
downloadopenssl-new-fb0f65fff831d9294e34b6ef6f579c157db54b04.tar.gz
Fix lock leak in evp_keymgmt_util_export_to_provider()
Fixes #16847 Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16849)
Diffstat (limited to 'crypto/evp/keymgmt_lib.c')
-rw-r--r--crypto/evp/keymgmt_lib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/evp/keymgmt_lib.c b/crypto/evp/keymgmt_lib.c
index 32e4fbcbaa..875c9a83de 100644
--- a/crypto/evp/keymgmt_lib.c
+++ b/crypto/evp/keymgmt_lib.c
@@ -197,6 +197,7 @@ void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt)
/* Add the new export to the operation cache */
if (!evp_keymgmt_util_cache_keydata(pk, keymgmt, import_data.keydata)) {
+ CRYPTO_THREAD_unlock(pk->lock);
evp_keymgmt_freedata(keymgmt, import_data.keydata);
return NULL;
}