]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Leave module_thread_inst_list around if thread instantiation fails
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 18 Apr 2022 22:36:26 +0000 (17:36 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 18 Apr 2022 22:36:26 +0000 (17:36 -0500)
src/lib/server/module.c

index 9f37c5934b2cffc5acf4da47fd0b6c8fcd0697d0..5347d0c17b27686514206f83b1242cad367bd543 100644 (file)
@@ -654,8 +654,8 @@ int modules_thread_instantiate(TALLOC_CTX *ctx, module_list_t const *ml, fr_even
                if (mi->module->thread_instantiate &&
                    mi->module->thread_instantiate(MODULE_THREAD_INST_CTX(mi->dl_inst, ti->data, el)) < 0) {
                        PERROR("Thread instantiation failed for module \"%s\"", mi->name);
+                       /* Leave module_thread_inst_list intact, other modules may need to clean up */
                        modules_thread_detach(ml);
-                       TALLOC_FREE(module_thread_inst_list);
                        return -1;
                }