]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
plug potential memory leak in error code path
authorAlexandr Nedvedicky <sashan@openssl.org>
Thu, 14 Mar 2024 08:53:56 +0000 (09:53 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 15 Mar 2024 12:42:57 +0000 (13:42 +0100)
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)

crypto/conf/conf_mod.c

index e10c18a29faaecd2819da21a75c28dcd5c5f437d..0b703826a75a8c5e178912962cc25f1684ce6d31 100644 (file)
@@ -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;
 }