diff --git a/ChangeLog b/ChangeLog index 6b85eb82..83da5053 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rant - replaced all calls to time(NULL) with me.now, which is updated a couple of times each loop. Should reduce the number of system calls a bit. - StatServ has had big performance improvements with regards to the database. Now progressively saves channel data, and only loads channel data when required. Should stop some of those mysterious 8 hour pingouts on large networks and reduce memory overhead ! - dont do assertion checking by default anymore. We are pretty stable. pass --enable-debug to configure to enable if you have weird crashes now + - Some Memory Leak cleanups * NeoStats * Fish (F) & Mark (M)* Version 2.5.7 - Update parse() and splitbuf to suport IRCu (F) diff --git a/dl.c b/dl.c index 04ef18a9..e15a8898 100644 --- a/dl.c +++ b/dl.c @@ -455,6 +455,7 @@ del_bot_from_chan (char *bot, char *chan) hnode_t *cbn; Chan_Bot *bc; lnode_t *bmn; + char *botname; cbn = hash_lookup (bch, chan); if (!cbn) { @@ -468,12 +469,13 @@ del_bot_from_chan (char *bot, char *chan) return; } list_delete (bc->bots, bmn); - free (lnode_get (bmn)); + botname = lnode_get(bmn); + free (botname); + lnode_destroy (bmn); if (list_isempty (bc->bots)) { /* delete the hash and list because its all over */ hash_delete (bch, cbn); list_destroy (bc->bots); - lnode_destroy (bmn); free (bc->chan); hnode_destroy (cbn); } @@ -560,7 +562,6 @@ new_bot (char *bot_name) strsetnull (u->nick); else strlcpy (u->nick, bot_name, MAXNICK); - u->chanlist = hash_create (C_TABLE_SIZE, 0, 0); bn = hnode_create (u); if (hash_isfull (bh)) { chanalert (s_Services, "Warning ModuleBotlist is full"); diff --git a/dl.h b/dl.h index cc8177cf..541fa374 100644 --- a/dl.h +++ b/dl.h @@ -144,8 +144,6 @@ typedef struct { message_function function; /** function */ chan_message_function chanfunc; - /** channel list */ - hash_t *chanlist; }Mod_User; hash_t *bh; diff --git a/dl/statserv/database.c b/dl/statserv/database.c index 2e43eeeb..014c821a 100644 --- a/dl/statserv/database.c +++ b/dl/statserv/database.c @@ -258,6 +258,7 @@ CStats *load_chan(char *name) { /* its the new database format... Good */ sscanf(data, "%ld %ld %ld %ld %ld %ld %ld %ld %ld", &c->topics, &c->totmem, &c->kicks, &c->maxmems, &c->t_maxmems, &c->maxkicks, &c->t_maxkicks, &c->maxjoins, &c->t_maxjoins); GetData((void *)&c->lastseen, CFGINT, "ChanStats", c->name, "LastSeen"); + free(data); } else if (GetData((void *)&c->topics, CFGINT, "ChanStats", c->name, "Topics") > 0) { GetData((void *)&c->totmem, CFGINT, "ChanStats", c->name, "TotalMems"); GetData((void *)&c->kicks, CFGINT, "ChanStats", c->name, "Kicks"); @@ -281,7 +282,6 @@ CStats *load_chan(char *name) { c->maxjoins = 0; c->t_maxjoins = c->t_maxmems; } - free(data); c->topicstoday = 0; c->joinstoday = 0; c->members = 0; diff --git a/ircd.c b/ircd.c index ccf4f564..de375e19 100644 --- a/ircd.c +++ b/ircd.c @@ -109,6 +109,7 @@ del_bot (char *nick, char *reason) nlog (LOG_WARNING, LOG_CORE, "Attempting to Logoff with a Nickname that does not Exists: %s", nick); return NS_FAILURE; } + //XXXX TODO: need to free the channel list hash. We dont according to valgrind squit_cmd (nick, reason); del_mod_user (nick); return NS_SUCCESS;