Fixed seg fault when mods for some reason fail fail to load.

This commit is contained in:
2022-08-27 10:40:13 +02:00
parent 4995cac9b8
commit 79b688c38e
4 changed files with 8 additions and 3 deletions

View File

@ -190,7 +190,10 @@ struct cw_Mod *cw_mod_load(const char *mod_name, cw_Cfg_t * global_cfg, int role
}
cw_dbg(DBG_MOD, "MOD: %s sucessfull loaded, calling init now.", filename);
mod->init(mod, global_cfg, role);
if (!mod->init(mod, global_cfg, role)){
dlclose(handle);
mod=NULL;
}
errX:
free(filename);