From f160e592ad3eadb551b6b066a245336bc2cfc81e Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 10 Nov 2006 18:42:01 +0000 Subject: Whoops, properly handle rehash now that new filters might be added by /FILTER git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5672 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_filter_pcre.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index dde7575ab..a7829871f 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -81,6 +81,7 @@ class ModuleFilterPCRE : public FilterBase { if (i->freeform == freeform) { + pcre_free((*i).regexp); filters.erase(i); return true; } @@ -125,13 +126,10 @@ class ModuleFilterPCRE : public FilterBase { ConfigReader MyConf(ServerInstance); - for (std::vector::iterator i = filters.begin(); i != filters.end(); i++) - pcre_free((*i).regexp); - - filters.clear(); - for (int index = 0; index < MyConf.Enumerate("keyword"); index++) { + this->DeleteFilter(MyConf.ReadValue("keyword", "pattern", index)); + std::string pattern = MyConf.ReadValue("keyword", "pattern", index); std::string reason = MyConf.ReadValue("keyword", "reason", index); std::string action = MyConf.ReadValue("keyword", "action", index); -- cgit v1.2.3