]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add missing unlock to ossl_provider_new
authortwo-heart <12869538+two-heart@users.noreply.github.com>
Thu, 4 Sep 2025 09:18:01 +0000 (11:18 +0200)
committerPauli <ppzgs1@gmail.com>
Fri, 5 Sep 2025 11:06:48 +0000 (21:06 +1000)
unlock on the early return path

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28437)

(cherry picked from commit c89b46826caff4ced320268f284d963ff06dee77)

crypto/provider_core.c

index ce5cf36eef9ddc5b931b27d263e3f5c13ae85869..c71c1e74468d2742b521e47693a9ae3e9a3687c6 100644 (file)
@@ -562,8 +562,10 @@ OSSL_PROVIDER *ossl_provider_new(OSSL_LIB_CTX *libctx, const char *name,
             template.parameters = sk_INFOPAIR_deep_copy(p->parameters,
                                                         infopair_copy,
                                                         infopair_free);
-            if (template.parameters == NULL)
+            if (template.parameters == NULL) {
+                CRYPTO_THREAD_unlock(store->lock);
                 return NULL;
+            }
             break;
         }
         CRYPTO_THREAD_unlock(store->lock);