]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix another close/ev_modify race
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Mar 2020 11:18:58 +0000 (12:18 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Mar 2020 11:18:58 +0000 (12:18 +0100)
src/libserver/http/http_context.c

index 519e4fb04e25e46329e70cb512c42b0fe84a282a..2863c0fbc19bb085f51040e4673290ab6952e923 100644 (file)
@@ -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);
 }