From f12d9060f95b0705140619ee4237a0f881b3478d Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Sat, 30 Jul 2022 21:46:17 +0200 Subject: [PATCH] Fixed bad mavl storage size --- src/cw/mod.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cw/mod.c b/src/cw/mod.c index 8a551f46..8eaff381 100644 --- a/src/cw/mod.c +++ b/src/cw/mod.c @@ -105,7 +105,7 @@ struct cw_MsgSet *cw_mod_get_msg_set(struct conn *conn, struct cw_MsgSet *set; if (!msgset_cache) { - msgset_cache = mavl_create(cmp, NULL, 1312); + msgset_cache = mavl_create(cmp, NULL, sizeof(struct cache_item*)); if (!msgset_cache) { cw_log(LOG_ERR, "Can't initialize msgset cache: %s", strerror(errno)); @@ -213,7 +213,7 @@ struct cw_Mod *cw_mod_load(const char *mod_name, mavl_t global_cfg, int role) /* if modlist is not initialized, initialize ... */ if (mods_loaded == NULL) { - mods_loaded = mavl_create(mod_cmp_mavl, NULL, 1312); + mods_loaded = mavl_create(mod_cmp_mavl, NULL, sizeof(struct cw_Mod*)); if (mods_loaded == NULL) { cw_log(LOG_ERROR, "Can't init modlist, no memory"); return NULL; @@ -272,8 +272,10 @@ struct cw_Mod *cw_mod_load(const char *mod_name, mavl_t global_cfg, int role) cw_log(LOG_ERR, "Can' add module %s", mod_name); goto errX; } + cw_dbg(DBG_MOD, "MOD: %s sucessfull loaded, calling init now.", filename); mod->init(mod, global_cfg, role); + errX: free(filename); return mod;