summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandr Nedvedicky <sashan@openssl.org>2024-03-14 09:53:56 +0100
committerTomas Mraz <tomas@openssl.org>2024-03-15 13:42:57 +0100
commit707b54bee2abbfe94a80361ab97cf77e1e4746bb (patch)
treefe00487b9aa10b39e5409907d0b88d232ea50954
parent12f5f26e1e71fe0375d82df70df338b8666ef38f (diff)
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 <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23836)
-rw-r--r--crypto/conf/conf_mod.c1
1 files changed, 1 insertions, 0 deletions
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;
}