From 6862a6bff243d5b57fb64e8ece97f65c6cc9ac16 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 30 Jun 2024 16:22:41 +0100 Subject: [PATCH] [Minor] Set mres earlier Issue: #5028 --- src/libstat/stat_process.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index 33b7053f8..e7b6b43f0 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -974,7 +974,7 @@ rspamd_stat_check_autolearn(struct rspamd_task *task) struct rspamd_stat_ctx *st_ctx; struct rspamd_classifier *cl; const ucl_object_t *obj, *elt1, *elt2; - struct rspamd_scan_result *mres = NULL; + struct rspamd_scan_result *mres = task->result; struct rspamd_task **ptask; lua_State *L; unsigned int i; @@ -1005,7 +1005,6 @@ rspamd_stat_check_autolearn(struct rspamd_task *task) * - We learn spam if action is ACTION_REJECT * - We learn ham if score is less than zero */ - mres = task->result; if (mres) { if (mres->score > rspamd_task_get_required_score(task, mres)) { @@ -1044,8 +1043,6 @@ rspamd_stat_check_autolearn(struct rspamd_task *task) spam_score = t; } - mres = task->result; - if (mres) { if (mres->score >= spam_score) { task->flags |= RSPAMD_TASK_FLAG_LEARN_SPAM; -- 2.39.5