diff options
author | Tomas Mraz <tomas@openssl.org> | 2024-04-11 09:27:47 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-04-12 10:58:38 +0200 |
commit | 875db35ac63beb0e5a3d520743fa55ad2e5ccd1d (patch) | |
tree | bee645d79182aa0dc00783b09c239db65a78bf23 /crypto | |
parent | 682ed1b86ebe97036ab37897d528343d0e4def69 (diff) |
ossl_provider_new(): Fix memory leak on error
Fixes #24095
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24100)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/provider_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/provider_core.c b/crypto/provider_core.c index 8046b0b48c..b0cb039705 100644 --- a/crypto/provider_core.c +++ b/crypto/provider_core.c @@ -564,8 +564,10 @@ OSSL_PROVIDER *ossl_provider_new(OSSL_LIB_CTX *libctx, const char *name, if (params[i].data_type != OSSL_PARAM_UTF8_STRING) continue; if (ossl_provider_info_add_parameter(&template, params[i].key, - (char *)params[i].data) <= 0) + (char *)params[i].data) <= 0) { + sk_INFOPAIR_pop_free(template.parameters, infopair_free); return NULL; + } } } |