aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-15 13:41:38 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-15 13:41:38 +0000
commitc124d925f84c2ef76f57cfe9925709f2fb71eadb (patch)
tree9a8e34897910a9e502e6b4bbfe20dee2fb1d00d2 /src/libserver
parentf7f214e35357609cc0968bfc4c79374802a7a405 (diff)
downloadrspamd-c124d925f84c2ef76f57cfe9925709f2fb71eadb.tar.gz
rspamd-c124d925f84c2ef76f57cfe9925709f2fb71eadb.zip
Fix a huge memory leak in hyperscan
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/re_cache.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index e9a18cfdd..82bd55dac 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -1440,7 +1440,22 @@ rspamd_re_cache_load_hyperscan (struct rspamd_re_cache *cache,
}
munmap (map, st.st_size);
+
+ if (re_class->hs_scratch != NULL) {
+ hs_free_scratch (re_class->hs_scratch);
+ }
+
+ if (re_class->hs_db != NULL) {
+ hs_free_database (re_class->hs_db);
+ }
+
+ if (re_class->hs_ids) {
+ g_free (re_class->hs_ids);
+ }
+
+ re_class->hs_ids = NULL;
re_class->hs_scratch = NULL;
+ re_class->hs_db = NULL;
g_assert (hs_alloc_scratch (re_class->hs_db,
&re_class->hs_scratch) == HS_SUCCESS);