From 6a1892b1c1bdd8e8ecb519933ee9887adb5b8585 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 6 May 2013 17:39:24 +0100 Subject: Fix an extremely low risk crash bug in m_connectban. --- src/modules/m_connectban.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index dc2bc3f18..26120add9 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -97,11 +97,12 @@ class ModuleConnectBan : public Module { // Create zline for set duration. ZLine* zl = new ZLine(ServerInstance->Time(), banduration, ServerInstance->Config->ServerName, "Your IP range has been attempting to connect too many times in too short a duration. Wait a while, and you will be able to connect.", mask.str()); - if (ServerInstance->XLines->AddLine(zl,NULL)) - ServerInstance->XLines->ApplyLines(); - else + if (!ServerInstance->XLines->AddLine(zl, NULL)) + { delete zl; - + return; + } + ServerInstance->XLines->ApplyLines(); std::string maskstr = mask.str(); std::string timestr = ServerInstance->TimeString(zl->expiry); ServerInstance->SNO->WriteGlobalSno('x',"Module m_connectban added Z:line on *@%s to expire on %s: Connect flooding", -- cgit v1.2.3