summaryrefslogtreecommitdiffstats
path: root/crypto
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:44 +1100
commit0f67990573fc2e556487d84878d6b71bf0b036a7 (patch)
treeaff59ec154cfdb3b6fc7da2ec2b6e7c4a1512c57 /crypto
parent45e6a9747360910e2161095a0816043657842d76 (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)
Diffstat (limited to 'crypto')
-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 16728f9c12..2fa01ac881 100644
--- a/crypto/provider_child.c
+++ b/crypto/provider_child.c
@@ -142,8 +142,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)) {