summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuili Fang <ruili.fang.98@gmail.com>2023-01-28 23:48:24 -0500
committerPauli <pauli@openssl.org>2023-02-01 08:20:26 +1100
commit26328e53b042b690acb6bd24b30017b7624406ee (patch)
treecddb5779eeb408d404de2fecc0570be54b59ef16
parent008d81694d5507aa717eb19401def64e68ef636a (diff)
Fix a potential memory leak in crypto/provider_child.c
Fix issue #20063. CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20163) (cherry picked from commit e788c772b12eea5ced4ce46619e13acf0e0eb6ba)
-rw-r--r--crypto/provider_child.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/provider_child.c b/crypto/provider_child.c
index b1eadd5b19..176a3a5cb2 100644
--- a/crypto/provider_child.c
+++ b/crypto/provider_child.c
@@ -135,8 +135,10 @@ static int provider_create_child_cb(const OSSL_CORE_HANDLE *prov, void *cbdata)
1)) == NULL)
goto err;
- if (!ossl_provider_activate(cprov, 0, 0))
+ if (!ossl_provider_activate(cprov, 0, 0)) {
+ ossl_provider_free(cprov);
goto err;
+ }
if (!ossl_provider_set_child(cprov, prov)
|| !ossl_provider_add_to_store(cprov, NULL, 0)) {