diff options
Diffstat (limited to 'modules/core/bs_main.cpp')
-rw-r--r-- | modules/core/bs_main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/core/bs_main.cpp b/modules/core/bs_main.cpp index 159adde93..442d522db 100644 --- a/modules/core/bs_main.cpp +++ b/modules/core/bs_main.cpp @@ -124,13 +124,15 @@ class BanDataPurger : public CallBack std::map<Anope::string, BanData> bandata; if (c->GetExtRegular("bs_main_bandata", bandata)) { - for (std::map<Anope::string, BanData>::iterator it2 = bandata.begin(), it2_end = bandata.end(); it2 != it2_end; ++it2) + for (std::map<Anope::string, BanData>::iterator it2 = bandata.begin(), it2_end = bandata.end(); it2 != it2_end;) { + const Anope::string &user = it->first; BanData *bd = &it2->second; + ++it2; if (Anope::CurTime - bd->last_use > Config->BSKeepData) { - bandata.erase(it2); + bandata.erase(user); continue; } } |