From: Vsevolod Stakhov Date: Mon, 30 Mar 2020 11:18:58 +0000 (+0100) Subject: [Minor] Fix another close/ev_modify race X-Git-Tag: 2.5~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bae50b5b9c55336f4ca8620d5ef72745ec0d593f;p=thirdparty%2Frspamd.git [Minor] Fix another close/ev_modify race --- diff --git a/src/libserver/http/http_context.c b/src/libserver/http/http_context.c index 519e4fb04e..2863c0fbc1 100644 --- a/src/libserver/http/http_context.c +++ b/src/libserver/http/http_context.c @@ -492,8 +492,9 @@ rspamd_http_keepalive_handler (gint fd, short what, gpointer ud) rspamd_inet_address_to_string_pretty (cbdata->conn->keepalive_hash_key->addr), cbdata->conn->keepalive_hash_key->host, cbdata->queue->length); - rspamd_http_connection_unref (cbdata->conn); + /* unref call closes fd, so we need to remove ev watcher first! */ rspamd_ev_watcher_stop (cbdata->ctx->event_loop, &cbdata->ev); + rspamd_http_connection_unref (cbdata->conn); g_free (cbdata); }