]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Deinit libs in client
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Sep 2020 13:07:28 +0000 (14:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Sep 2020 13:07:28 +0000 (14:07 +0100)
src/client/rspamc.c
src/plugins/fuzzy_check.c

index 99bff19c8934f24a62fcd2b551218fd99f524ffa..c2dd3a5d274a1f7f0363dacfdedcaf54bde33035 100644 (file)
@@ -1933,7 +1933,7 @@ main (gint argc, gchar **argv, gchar **env)
                }
        }
 
-       rspamd_init_libs ();
+       struct rspamd_external_libs_ctx *libs = rspamd_init_libs ();
        event_loop = ev_loop_new (EVBACKEND_ALL);
 
        struct rspamd_http_context_cfg http_config;
@@ -2087,6 +2087,8 @@ main (gint argc, gchar **argv, gchar **env)
                g_pattern_spec_free (exclude_compiled[i]);
        }
 
+       rspamd_deinit_libs (libs);
+
        /* Mix retcode (return from Rspamd side) and ret (return from subprocess) */
        return ret | retcode;
 }
index b898ff2b2daf61e546e93018f7197e18e7008fd6..6211b22f196df523252eaff0b85661bf05405c39 100644 (file)
@@ -1653,7 +1653,7 @@ fuzzy_cmd_from_text_part (struct rspamd_task *task,
                }
        }
        else {
-               cached = rspamd_mempool_alloc (task->task_pool, sizeof (*cached));
+               cached = rspamd_mempool_alloc0 (task->task_pool, sizeof (*cached));
                additional_length = fuzzy_cmd_extension_length (task, rule);
                cached->additional_length = additional_length;