diff options
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_filter_pcre.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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<PCREFilter>::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); |