aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-30 14:15:56 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-30 15:26:43 +0100
commit7f00a43bac02bbbb2308b524f052601b000e5a09 (patch)
tree3d743db2e447bdf60621214aa15dbf5e17e7813a /src/libutil
parent67667856ab59e89e573980eb2002e02db742d50b (diff)
downloadrspamd-7f00a43bac02bbbb2308b524f052601b000e5a09.tar.gz
rspamd-7f00a43bac02bbbb2308b524f052601b000e5a09.zip
[Fix] Do not leave temporary maps cached
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/map.c5
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);
}