commit f6d8cb0: [Minor] Deinit libs in client

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Sep 10 13:56:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-10 14:07:28 +0100
URL: https://github.com/rspamd/rspamd/commit/f6d8cb00f91907d13d9a8f7aed49f8525dcef399

[Minor] Deinit libs in client

---
 src/client/rspamc.c       | 4 +++-
 src/plugins/fuzzy_check.c | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/client/rspamc.c b/src/client/rspamc.c
index 99bff19c8..c2dd3a5d2 100644
--- a/src/client/rspamc.c
+++ b/src/client/rspamc.c
@@ -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;
 }
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index b898ff2b2..6211b22f1 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -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;
 


More information about the Commits mailing list