summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorshridhar kalavagunta <coolshrid@hotmail.com>2024-04-12 03:42:37 +0200
committerTomas Mraz <tomas@openssl.org>2024-06-05 13:15:29 +0200
commit5bbdbce856c7ca132e039a24a315618484874c81 (patch)
tree3a4fe01a375cf5d152d7524032ef21a10ae2ebc9 /crypto
parentAllow group methods to customize initialization for speed (diff)
downloadopenssl-5bbdbce856c7ca132e039a24a315618484874c81.tar.xz
openssl-5bbdbce856c7ca132e039a24a315618484874c81.zip
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)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/conf/conf_mod.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c
index ffdde5f467..1ac3d9f7b7 100644
--- a/crypto/conf/conf_mod.c
+++ b/crypto/conf/conf_mod.c
@@ -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);