X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_connectban.cpp;h=26120add984381529a736bcd3af0f8b67b4e0d61;hb=fc4fc43ec232407b38d7ca182cb92c5cac4287aa;hp=dc2bc3f18b80eb0aebb3a195712d3e0d43f25806;hpb=e59bb59ea29e73bf66139e9d5eab6d1b572e308d;p=user%2Fhenk%2Fcode%2Finspircd.git 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",