mirror of
https://github.com/openssl/openssl.git
synced 2026-01-18 17:11:31 +01:00
Fix memory leak on error in crypto/conf/conf_mod.c
Fixes #24111 Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24119)
This commit is contained in:
committed by
Tomas Mraz
parent
23b6ef4894
commit
5bbdbce856
@@ -528,13 +528,14 @@ void CONF_modules_unload(int all)
|
||||
|
||||
old_modules = ossl_rcu_deref(&supported_modules);
|
||||
new_modules = sk_CONF_MODULE_dup(old_modules);
|
||||
to_delete = sk_CONF_MODULE_new_null();
|
||||
|
||||
if (new_modules == NULL) {
|
||||
ossl_rcu_write_unlock(module_list_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
to_delete = sk_CONF_MODULE_new_null();
|
||||
|
||||
/* unload modules in reverse order */
|
||||
for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
|
||||
md = sk_CONF_MODULE_value(new_modules, i);
|
||||
|
||||
Reference in New Issue
Block a user