summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-04-17 13:55:07 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-04-17 13:55:07 +0000
commitfbd9bba660330f94e2e9c5b687e0fee25bd8f980 (patch)
tree4a5f9d61f2004c6b99e0f551da6936056dc96f38 /src/modules
parent2dfc384cde46ba63ed7c2f4420712596096123ca (diff)
Fix memory leak in m_filter rehash
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11308 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_filter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 55094b429..514fd7e6b 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -408,16 +408,16 @@ int FilterBase::OnPreCommand(std::string &command, std::vector<std::string> &par
void FilterBase::OnRehash(User* user, const std::string &parameter)
{
- ConfigReader* MyConf = new ConfigReader(ServerInstance);
+ ConfigReader MyConf(ServerInstance);
std::vector<std::string>().swap(exemptfromfilter);
- for (int index = 0; index < MyConf->Enumerate("exemptfromfilter"); ++index)
+ for (int index = 0; index < MyConf.Enumerate("exemptfromfilter"); ++index)
{
- std::string chan = MyConf->ReadValue("exemptfromfilter", "channel", index);
+ std::string chan = MyConf.ReadValue("exemptfromfilter", "channel", index);
if (!chan.empty()) {
exemptfromfilter.push_back(chan);
}
}
- std::string newrxengine = MyConf->ReadValue("filteropts", "engine", 0);
+ std::string newrxengine = MyConf.ReadValue("filteropts", "engine", 0);
if (!RegexEngine.empty())
{
if (RegexEngine == newrxengine)
@@ -445,8 +445,6 @@ void FilterBase::OnRehash(User* user, const std::string &parameter)
{
ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Regex engine '%s' is not loaded - Filter functionality disabled until this is corrected.", RegexEngine.c_str());
}
-
- delete MyConf;
}
void FilterBase::OnLoadModule(Module* mod, const std::string& name)