aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libstat/stat_process.c5
1 files changed, 1 insertions, 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;