From 18816c9485063d48a11b0536f299512924b49ab4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 20 Jul 2010 17:19:04 +0400 Subject: [PATCH] * Fix another error with early task destroying --- src/plugins/spf.c | 7 +++++++ src/spf.c | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/spf.c b/src/plugins/spf.c index 6ab23ee37..315e57f58 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -162,10 +162,17 @@ spf_plugin_callback (struct spf_record *record, struct worker_task *task) } cur = g_list_next (cur); } + if (record->addrs != NULL) { + /* Free addresses that we already proceed */ + g_list_free (record->addrs); + record->addrs = NULL; + } } + if (task->save.saved == 0) { /* Call other filters */ task->save.saved = 1; + /* Note that here task MAY be destroyed */ process_filters (task); } } diff --git a/src/spf.c b/src/spf.c index 79a0855ea..7a8de6746 100644 --- a/src/spf.c +++ b/src/spf.c @@ -381,10 +381,6 @@ spf_record_dns_callback (struct rspamd_dns_reply *reply, gpointer arg) cb->rec->task->save.saved--; if (cb->rec->task->save.saved == 0 && cb->rec->callback) { cb->rec->callback (cb->rec, cb->rec->task); - if (cb->rec->addrs) { - g_list_free (cb->rec->addrs); - cb->rec->addrs = NULL; - } } } -- 2.39.5