modules: clear module list and mod paths in init

If main is called more than once (like in tests), everything is
reinitialized except the loaded module list and module paths, so clear
them too so that modules are loaded again and the path list is correct.
This commit is contained in:
Doug Freed 2023-06-23 00:00:55 +00:00 committed by Stephen Bennett
parent c33da0d24e
commit 7a2ccb077f

View file

@ -77,6 +77,9 @@ init_modules(void)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
memset(&module_list, 0, sizeof(module_list));
memset(&mod_paths, 0, sizeof(mod_paths));
/* Add the default paths we look in to the module system --nenolod */ /* Add the default paths we look in to the module system --nenolod */
mod_add_path(ircd_paths[IRCD_PATH_MODULES]); mod_add_path(ircd_paths[IRCD_PATH_MODULES]);
mod_add_path(ircd_paths[IRCD_PATH_AUTOLOAD_MODULES]); mod_add_path(ircd_paths[IRCD_PATH_AUTOLOAD_MODULES]);