]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Destroy old LRU cache to avoid reload leaks
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Nov 2019 11:53:58 +0000 (11:53 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Nov 2019 11:53:58 +0000 (11:53 +0000)
src/libserver/spf.c

index 0d508ec15d380118bfe5272bfeed1d3bd4a10f6f..5fac43aa1bce2c837c1303fa9e80ebd4fe80a1bc 100644 (file)
@@ -198,6 +198,11 @@ spf_library_config (const ucl_object_t *obj)
                }
        }
 
+       if (spf_lib_ctx->spf_hash) {
+               rspamd_lru_hash_destroy (spf_lib_ctx->spf_hash);
+               spf_lib_ctx->spf_hash = NULL;
+       }
+
        if ((value = ucl_object_find_key (obj, "spf_cache_size")) != NULL) {
                if (ucl_object_toint_safe (value, &ival) && ival > 0) {
                        spf_lib_ctx->spf_hash = rspamd_lru_hash_new (