Skip to content

Commit

Permalink
Fix memory leak on error in crypto/conf/conf_mod.c
Browse files Browse the repository at this point in the history
Fixes openssl#24111

Reviewed-by: Tom Cosgrove <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#24119)
  • Loading branch information
coolshrid authored and t8m committed Jun 5, 2024
1 parent 23b6ef4 commit 5bbdbce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/conf/conf_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5bbdbce

Please sign in to comment.