Browse Source

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)
Alexandr Nedvedicky 1 month ago
parent
commit
707b54bee2
1 changed files with 1 additions and 0 deletions
  1. 1 0
      crypto/conf/conf_mod.c

+ 1 - 0
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;
 }