diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-26 13:39:52 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-26 13:39:52 +0000 |
commit | c6eb33fa9c32101c6519e7b69a1bb92ab29524f8 (patch) | |
tree | 7efc5ba8d2ba8d3a77b691e43c75ee0f12c18673 | |
parent | b3c76ba413fe3ca41018a2a828194614b7bcb7a9 (diff) | |
download | rspamd-c6eb33fa9c32101c6519e7b69a1bb92ab29524f8.tar.gz rspamd-c6eb33fa9c32101c6519e7b69a1bb92ab29524f8.zip |
Fix double free for the controller.
-rw-r--r-- | src/plugins/fuzzy_check.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index e7af9f42e..2db7e8da7 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -1161,7 +1161,10 @@ cleanup: "{\"success\":true}"); } - rspamd_task_free (session->task, TRUE); + if (session->task != NULL) { + rspamd_task_free (session->task, TRUE); + session->task = NULL; + } } @@ -1180,7 +1183,15 @@ fuzzy_controller_timer_callback (gint fd, short what, void *arg) msg_err_task ("got IO timeout with server %s, after %d retransmits", rspamd_upstream_name (session->server), session->retransmits); - rspamd_task_free (session->task, TRUE); + + if (*session->saved > 0 ) { + (*session->saved)--; + if (*session->saved == 0 && session->task != NULL) { + rspamd_task_free (session->task, TRUE); + session->task = NULL; + } + } + rspamd_http_connection_unref (session->http_entry->conn); event_del (&session->ev); event_del (&session->timev); |