From c119d290bc3767204968a563073756a66d15e3d6 Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 2 Nov 2008 04:18:52 +0000 Subject: Backport leak on /rehash fix. git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@10788 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index f072cdbb9..1ca24fcb3 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -552,7 +552,13 @@ const char* CommandParser::LoadCommand(const char* name) void CommandParser::SetupCommandTable(userrec* user) { - RFCCommands.clear(); + for (SharedObjectList::iterator command = RFCCommands.begin(); command != RFCCommands.end(); command++) + { + command_t *cmdptr = cmdlist.find(command->first)->second; + cmdlist.erase(cmdlist.find(command->first)); + RFCCommands.erase(command); + delete cmdptr; + } if (!user) { -- cgit v1.3.1-10-gc9f91