diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-29 19:21:54 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-29 19:21:54 +0000 |
commit | ee22947a7e09c7a708a679931c37b7791c72e9b5 (patch) | |
tree | 3a49cf8c65945b95dec970eb28b7458f19169e09 /src/modules/extra | |
parent | b92a2915d5e8a45c4d76942040075e4fc9fc07d2 (diff) |
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
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_filter_pcre.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<Filter>::iterator i = filters.begin(); i != filters.end(); i++) + pcre_free((*i).regexp); + filters.clear(); for (int index = 0; index < MyConf.Enumerate("keyword"); index++) |