diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-30 14:15:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-30 15:26:43 +0100 |
commit | 7f00a43bac02bbbb2308b524f052601b000e5a09 (patch) | |
tree | 3d743db2e447bdf60621214aa15dbf5e17e7813a /src/libutil | |
parent | 67667856ab59e89e573980eb2002e02db742d50b (diff) | |
download | rspamd-7f00a43bac02bbbb2308b524f052601b000e5a09.tar.gz rspamd-7f00a43bac02bbbb2308b524f052601b000e5a09.zip |
[Fix] Do not leave temporary maps cached
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/map.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index eafb85f11..a29939f26 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -271,6 +271,7 @@ free_http_cbdata_common (struct http_callback_data *cbd, gboolean plan_new) rspamd_inet_address_destroy (cbd->addr); } + MAP_RELEASE (cbd->bk, "rspamd_map_backend"); MAP_RELEASE (periodic, "periodic"); g_slice_free1 (sizeof (struct http_callback_data), cbd); @@ -998,6 +999,10 @@ rspamd_map_remove_all (struct rspamd_config *cfg) MAP_RELEASE (bk, "rspamd_map_backend"); } + if (g_atomic_int_compare_and_exchange (&map->cache->available, 1, 0)) { + unlink (map->cache->shmem_name); + } + if (map->dtor) { map->dtor (map->dtor_data); } |