aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Attila Molnar2013-05-06 18:18:50 -0700
committerGravatar Attila Molnar2013-05-06 18:18:50 -0700
commit39d894c54ed106a697d96a2aea90884dfd0a469c (patch)
tree86a2d56675b60a327780b9e00e06a0c811c118bb /src
parentm_ssl_gnutls Call gnutls_transport_set_errno() on Windows only (diff)
parentFix an extremely low risk crash bug in m_connectban. (diff)
downloadinspircd++-39d894c54ed106a697d96a2aea90884dfd0a469c.tar.gz
inspircd++-39d894c54ed106a697d96a2aea90884dfd0a469c.tar.bz2
inspircd++-39d894c54ed106a697d96a2aea90884dfd0a469c.zip
Merge pull request #526 from SaberUK/insp20+connectban-fix
[2.0] Fix an extremely low risk crash bug in m_connectban.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_connectban.cpp9
1 files changed, 5 insertions, 4 deletions
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",