From 707b54bee2abbfe94a80361ab97cf77e1e4746bb Mon Sep 17 00:00:00 2001 From: Alexandr Nedvedicky Date: Thu, 14 Mar 2024 09:53:56 +0100 Subject: plug potential memory leak in error code path Function `module_add()` may leak stack of modules when it fails to initialize newly added module. Fixes #23835 Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/23836) --- crypto/conf/conf_mod.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index e10c18a29f..0b703826a7 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -372,6 +372,7 @@ static CONF_MODULE *module_add(DSO *dso, const char *name, OPENSSL_free(tmod->name); OPENSSL_free(tmod); } + sk_CONF_MODULE_free(new_modules); return NULL; } -- cgit v1.2.3-70-g09d2