From 1735fc95bba84044d43d4490bd5916d0a52eb876 Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 17 Apr 2009 13:55:14 +0000 Subject: Fix memory leak on rehash: opertype used char* instead of std::string git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11309 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index e23f5750d..0fcf88e9d 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -2205,15 +2205,6 @@ bool ValueItem::GetBool() */ bool InitTypes(ServerConfig* conf, const char*) { - if (conf->opertypes.size()) - { - for (opertype_t::iterator n = conf->opertypes.begin(); n != conf->opertypes.end(); n++) - { - if (n->second) - delete[] n->second; - } - } - conf->opertypes.clear(); return true; } @@ -2250,7 +2241,7 @@ bool DoType(ServerConfig* conf, const char*, char**, ValueList &values, int*) const char* TypeName = values[0].GetString(); const char* Classes = values[1].GetString(); - conf->opertypes[TypeName] = strnewdup(Classes); + conf->opertypes[TypeName] = std::string(Classes); return true; } -- cgit v1.2.3