]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix order of objects destruction for http keepalive conns
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 29 Mar 2020 13:19:22 +0000 (14:19 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 29 Mar 2020 13:19:22 +0000 (14:19 +0100)
src/libserver/http/http_context.c

index 8db43841d8730a6171d5cb97b4236ceb38313f17..519e4fb04e25e46329e70cb512c42b0fe84a282a 100644 (file)
@@ -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;