From: Vsevolod Stakhov Date: Sun, 29 Mar 2020 13:19:22 +0000 (+0100) Subject: [Minor] Fix order of objects destruction for http keepalive conns X-Git-Tag: 2.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=230dcf4abeefa4b3c13a1776a78f6ea6afdb37c2;p=thirdparty%2Frspamd.git [Minor] Fix order of objects destruction for http keepalive conns --- diff --git a/src/libserver/http/http_context.c b/src/libserver/http/http_context.c index 8db43841d8..519e4fb04e 100644 --- a/src/libserver/http/http_context.c +++ b/src/libserver/http/http_context.c @@ -53,8 +53,9 @@ rspamd_http_keepalive_queue_cleanup (GQueue *conns) struct rspamd_http_keepalive_cbdata *cbd; cbd = (struct rspamd_http_keepalive_cbdata *)cur->data; - rspamd_http_connection_unref (cbd->conn); + /* unref call closes fd, so we need to remove ev watcher first! */ rspamd_ev_watcher_stop (cbd->ctx->event_loop, &cbd->ev); + rspamd_http_connection_unref (cbd->conn); g_free (cbd); cur = cur->next;