From 679a5e1f14168b32053b5c72f3115205fdbd0629 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 21 Aug 2014 16:26:51 +0100 Subject: [PATCH] Fix session-less resolver. --- src/libserver/dns.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libserver/dns.c b/src/libserver/dns.c index aa4877783..1410442b7 100644 --- a/src/libserver/dns.c +++ b/src/libserver/dns.c @@ -63,15 +63,15 @@ rspamd_dns_callback (struct rdns_reply *reply, gpointer ud) reqdata->cb (reply, reqdata->ud); - /* - * Ref event to avoid double unref by - * event removing - */ - rdns_request_retain (reply->request); if (reqdata->session) { - remove_normal_event (reqdata->session, rspamd_dns_fin_cb, reqdata->req); + /* + * Ref event to avoid double unref by + * event removing + */ + rdns_request_retain (reply->request); + remove_normal_event (reqdata->session, rspamd_dns_fin_cb, reqdata); } - if (reqdata->pool == NULL) { + else if (reqdata->pool == NULL) { g_slice_free1 (sizeof (struct rspamd_dns_request_ud), reqdata); } } -- 2.39.5