From b43eb6b7c45e26f2ce6fbf01f18bef8b03079933 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 9 Nov 2007 17:14:46 +0000 Subject: 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 --- src/modules/m_chanprotect.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/modules/m_chanprotect.cpp') diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 6d99ed10b..8f4bd8fb1 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -315,7 +315,11 @@ class ModuleChanProtect : public Module cf = new ChanFounder(ServerInstance,QAPrefixes,DeprivSelf,DeprivOthers); if (!ServerInstance->AddMode(cp, 'a') || !ServerInstance->AddMode(cf, 'q')) + { + delete cp; + delete cf; throw ModuleException("Could not add new modes!"); + } } void Implements(char* List) -- cgit v1.3.1-10-gc9f91