]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not leave temporary maps cached
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 30 Jun 2016 13:15:56 +0000 (14:15 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 30 Jun 2016 14:26:43 +0000 (15:26 +0100)
src/libutil/map.c

index eafb85f11c315f4d594d01f1c6c3bf235857c304..a29939f26bb9bf85cb9a711b0de0c052f25155ff 100644 (file)
@@ -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);
                }