mirror of https://github.com/openssl/openssl.git
crypto/provider_conf.c: Fix possible memory leak
Assign the return value of ossl_provider_info_add_to_store to added instead of setting it directly to 1, in order to avoid a memory leak caused by entry not being freed if ossl_provider_info_add_to_store() fails. Signed-off-by: JiashengJiang <jiasheng@purdue.edu> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27472)
This commit is contained in:
parent
3f5dc064d0
commit
9884f1dc11
|
@ -379,7 +379,7 @@ static int provider_conf_load(OSSL_LIB_CTX *libctx, const char *name,
|
|||
ok = provider_conf_params(NULL, &entry, NULL, value, cnf);
|
||||
if (ok >= 1 && (entry.path != NULL || entry.parameters != NULL)) {
|
||||
ok = ossl_provider_info_add_to_store(libctx, &entry);
|
||||
added = 1;
|
||||
added = ok;
|
||||
}
|
||||
if (added == 0)
|
||||
ossl_provider_info_clear(&entry);
|
||||
|
|
Loading…
Reference in New Issue