From ee22947a7e09c7a708a679931c37b7791c72e9b5 Mon Sep 17 00:00:00 2001 From: special Date: Fri, 29 Sep 2006 19:21:54 +0000 Subject: Made m_filter_pcre free the compiled regular expressions on rehash (no more memory leak) and fixed my previous fix git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5357 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_filter_pcre.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index 3f8cb7637..d040497d3 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -38,7 +38,7 @@ class FilterPCREException : public ModuleException }; /* $ModDesc: m_filter with regexps */ -/* $CompileFlags: -I`pcre-config --cflags` */ +/* $CompileFlags: `pcre-config --cflags` */ /* $LinkerFlags: `pcre-config --libs` `perl extra/pcre_rpath.pl` -lpcre */ class ModuleFilterPCRE : public Module @@ -154,6 +154,9 @@ class ModuleFilterPCRE : public Module ServerInstance->Log(DEFAULT,"m_filter_pcre: read configuration from "+filterfile); + 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++) -- cgit v1.2.3