]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix double free in collection mode
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 5 Feb 2017 11:37:39 +0000 (12:37 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 5 Feb 2017 11:37:39 +0000 (12:37 +0100)
src/fuzzy_storage.c

index b0606eb97c133b3046c1e5aac8d735e82fc0d5f7..7b939d3f04a6882e048122ba4228a7d6252d8949 100644 (file)
@@ -2859,10 +2859,13 @@ start_fuzzy (struct rspamd_worker *worker)
                rspamd_fuzzy_backend_close (ctx->backend);
        }
        else if (worker->index == 0) {
-               rspamd_http_router_free (ctx->collection_rt);
-               /* Try to save collection id */
                gint fd;
 
+               /* Steal keypairs cache... */
+               ctx->collection_rt->cache = NULL;
+               rspamd_http_router_free (ctx->collection_rt);
+
+               /* Try to save collection id */
                fd = rspamd_file_xopen (ctx->collection_id_file,
                                O_WRONLY | O_CREAT | O_TRUNC, 00644);