From 40e2310e6546325b79f38ef41f258284fe5c1b01 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 18 Sep 2014 14:16:46 +0100 Subject: [PATCH] Add cleanup. --- src/lmtp.c | 1 - src/main.c | 7 ++++++- test/rspamd_radix_test.c | 2 ++ test/rspamd_test_suite.c | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lmtp.c b/src/lmtp.c index 1243b3265..0b8a7a79f 100644 --- a/src/lmtp.c +++ b/src/lmtp.c @@ -315,7 +315,6 @@ start_lmtp (struct rspamd_worker *worker) worker->srv->pid = getpid (); worker->ctx = event_init (); - g_mime_init (0); init_signals (&signals, sig_handler); sigprocmask (SIG_UNBLOCK, &signals.sa_mask, NULL); diff --git a/src/main.c b/src/main.c index 0083407e7..8bbb07456 100644 --- a/src/main.c +++ b/src/main.c @@ -1337,7 +1337,11 @@ main (gint argc, gchar **argv, gchar **env) rspamd_main->cfg->mlock_statfile_pool); event_init (); +#ifdef GMIME_ENABLE_RFC2047_WORKAROUNDS + g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS); +#else g_mime_init (0); +#endif /* Init lua filters */ if (!rspamd_init_lua_filters (rspamd_main->cfg)) { @@ -1345,7 +1349,6 @@ main (gint argc, gchar **argv, gchar **env) exit (EXIT_FAILURE); } - /* Insert classifiers symbols */ (void)rspamd_config_insert_classify_symbols (rspamd_main->cfg); @@ -1500,6 +1503,8 @@ main (gint argc, gchar **argv, gchar **env) g_free (rspamd_main->cfg); g_free (rspamd_main); + g_mime_shutdown (); + #ifdef HAVE_OPENSSL EVP_cleanup (); ERR_free_strings (); diff --git a/test/rspamd_radix_test.c b/test/rspamd_radix_test.c index 661315dae..5e77b02f9 100644 --- a/test/rspamd_radix_test.c +++ b/test/rspamd_radix_test.c @@ -116,6 +116,8 @@ rspamd_radix_text_vec (void) } t ++; } + + radix_tree_destroy_compressed (tree); } void diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c index 36b66f05e..b3a154b63 100644 --- a/test/rspamd_test_suite.c +++ b/test/rspamd_test_suite.c @@ -21,6 +21,7 @@ main (int argc, char **argv) g_thread_init (NULL); #endif + g_mime_init (0); memset (rspamd_main, 0, sizeof (struct rspamd_main)); rspamd_main->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); rspamd_main->cfg = (struct rspamd_config *)g_malloc (sizeof (struct rspamd_config)); @@ -55,5 +56,7 @@ main (int argc, char **argv) g_test_run (); + g_mime_shutdown (); + return 0; } -- 2.39.5