From: Vsevolod Stakhov Date: Sat, 10 Jun 2017 11:39:30 +0000 (+0100) Subject: [Fix] Fix order of operations to avoid race condition X-Git-Tag: 1.6.0~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=de56563f68a2127119deb5bbbb26cfc3b12369fe;p=rspamd.git [Fix] Fix order of operations to avoid race condition --- diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index c84cfdc88..286abf34c 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -1801,10 +1801,7 @@ surbl_continue_process_handler (lua_State *L) param = (struct redirector_param *)lua_topointer (L, 2); if (param != NULL) { - task = param->task; - rspamd_session_watcher_pop (task->s, param->w); - param->w = NULL; if (nurl != NULL) { msg_info_surbl ("<%s> got reply from redirector: '%*s' -> '%*s'", @@ -1841,6 +1838,9 @@ surbl_continue_process_handler (lua_State *L) param->task->message_id, param->url->urllen, param->url->string); } + + rspamd_session_watcher_pop (task->s, param->w); + param->w = NULL; } else { return luaL_error (L, "invalid arguments");