]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Leak fix on /rehash
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 2 Nov 2008 04:18:42 +0000 (04:18 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 2 Nov 2008 04:18:42 +0000 (04:18 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10787 e03df62e-2008-0410-955e-edbf42e46eb7

src/command_parse.cpp

index e4c987c19c1cd1daaa44e539f0f55808f919c95f..3373f714f6330e566f52081f439388a89c44caa6 100644 (file)
@@ -593,7 +593,13 @@ const char* CommandParser::LoadCommand(const char* name)
 
 void CommandParser::SetupCommandTable(User* user)
 {
-       RFCCommands.clear();
+       for (SharedObjectList::iterator command = RFCCommands.begin(); command != RFCCommands.end(); command++)
+       {
+               Command *cmdptr = cmdlist.find(command->first)->second;
+               cmdlist.erase(cmdlist.find(command->first));
+               RFCCommands.erase(command);
+               delete cmdptr;
+       }
 
        if (!user)
        {