From c0bafe10b44d5dcbd4bd572d3752102c0bbf6d87 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 2 May 2026 10:54:18 +0100 Subject: [PATCH] Avoid double deleting the ban timer in cs_ban. --- modules/chanserv/cs_ban.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/chanserv/cs_ban.cpp b/modules/chanserv/cs_ban.cpp index b2af89845..e8544bcf9 100644 --- a/modules/chanserv/cs_ban.cpp +++ b/modules/chanserv/cs_ban.cpp @@ -28,6 +28,8 @@ private: Anope::string mode; public: + bool ticked = false; + TempBan(time_t seconds, Channel *c, const Anope::string &banmask, const Anope::string &mod) : Timer(me, seconds) , channel(c->name) @@ -53,6 +55,10 @@ public: void Tick() override { + // We need to do this to prevent the remove-on-unban logic from double + // deleting the timer. + ticked = true; + Channel *c = Channel::Find(this->channel); if (c) c->RemoveMode(NULL, mode, this->mask); @@ -290,7 +296,7 @@ public: { for (const auto *tempban : tempbans) { - if (tempban->Matches(c, cmode, param)) + if (!tempban->ticked && tempban->Matches(c, cmode, param)) { delete tempban; break;