summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-12-01 15:50:56 -0500
committerAdam <Adam@anope.org>2010-12-01 15:50:56 -0500
commit35f03811e899f7cef01a1d84f1167bdb43365e13 (patch)
tree1a67b5dfa3a105b0906ba1e5d8c423076794f732
parent14e396baf7115007ea68415b285e1bef3a2c2597 (diff)
Fixed clearing entries from the bandata cache
-rw-r--r--src/botserv.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/botserv.cpp b/src/botserv.cpp
index df1476dc8..9149a0027 100644
--- a/src/botserv.cpp
+++ b/src/botserv.cpp
@@ -387,8 +387,12 @@ static BanData *get_ban_data(Channel *c, User *u)
return NULL;
Anope::string mask = u->GetIdent() + "@" + u->GetDisplayedHost();
- for (std::list<BanData *>::iterator it = c->bd.begin(), it_end = c->bd.end(); it != it_end; ++it)
+ /* XXX This should really be on some sort of timer/garbage collector, and use std::map */
+ for (std::list<BanData *>::iterator it = c->bd.begin(), it_end = c->bd.end(), it_next; it != it_end; it = it_next)
{
+ it_next = it;
+ ++it_next;
+
if (Anope::CurTime - (*it)->last_use > Config->BSKeepData)
{
delete *it;