summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-29 14:19:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-29 14:19:22 +0100
commit230dcf4abeefa4b3c13a1776a78f6ea6afdb37c2 (patch)
treed1bfe5c8cc420ffbd3566c75a4cbdda48a3e9cca
parent4812f5ab9d22e65b254bef2085bcdab6fc76d42b (diff)
downloadrspamd-230dcf4abeefa4b3c13a1776a78f6ea6afdb37c2.tar.gz
rspamd-230dcf4abeefa4b3c13a1776a78f6ea6afdb37c2.zip
[Minor] Fix order of objects destruction for http keepalive conns
-rw-r--r--src/libserver/http/http_context.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libserver/http/http_context.c b/src/libserver/http/http_context.c
index 8db43841d..519e4fb04 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;