From 0f33be2964f8a47fa89c19c7c69375b46ffd6563 Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 2 Nov 2008 04:18:42 +0000 Subject: Leak fix on /rehash git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10787 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/command_parse.cpp b/src/command_parse.cpp index e4c987c19..3373f714f 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -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) { -- cgit v1.2.3