diff options
| author | 2007-11-09 17:14:46 +0000 | |
|---|---|---|
| committer | 2007-11-09 17:14:46 +0000 | |
| commit | b43eb6b7c45e26f2ce6fbf01f18bef8b03079933 (patch) | |
| tree | db5642affe37c53a96db8ecf3faa77a86b1aff7e /src/modules/m_censor.cpp | |
| parent | Make AddMode the last thing the constructor does. (diff) | |
Tidy up some minor memory leaks that can result in mode handlers or some other memory items not being freed if the module throws in the constructor
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8550 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_censor.cpp')
| -rw-r--r-- | src/modules/m_censor.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index f4a5bd620..9703e8334 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -101,7 +101,11 @@ class ModuleCensor : public Module cu = new CensorUser(ServerInstance); cc = new CensorChannel(ServerInstance); if (!ServerInstance->AddMode(cu, 'G') || !ServerInstance->AddMode(cc, 'G')) + { + delete cu; + delete cc; throw ModuleException("Could not add new modes!"); + } } void Implements(char* List) |
