Properly own the duplicated string
[openssl.git] / crypto / conf / conf_mod.c
index 101d1f1e75dea6289b97d9c137c6a492c7f07a4f..604518aef5a6f055031d18418d854da6c80d4144 100644 (file)
@@ -286,8 +286,13 @@ static CONF_MODULE *module_add(DSO *dso, const char *name,
     tmod->name = OPENSSL_strdup(name);
     tmod->init = ifunc;
     tmod->finish = ffunc;
+    if (tmod->name == NULL) {
+        OPENSSL_free(tmod);
+        return NULL;
+    }
 
     if (!sk_CONF_MODULE_push(supported_modules, tmod)) {
+        OPENSSL_free(tmod->name);
         OPENSSL_free(tmod);
         return NULL;
     }
@@ -460,7 +465,7 @@ int CONF_module_add(const char *name, conf_init_func *ifunc,
         return 0;
 }
 
-void int_conf_modules_free(void)
+void conf_modules_free_int(void)
 {
     CONF_modules_finish();
     CONF_modules_unload(1);