aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libutil/map.c10
-rw-r--r--src/libutil/map_private.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 3794cfcfa..ea295e7a4 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -294,8 +294,9 @@ free_http_cbdata_dtor (gpointer p)
struct rspamd_map *map;
map = cbd->map;
+ cbd->stage = map_finished;
msg_warn_map ("connection with http server is terminated: worker is stopping");
- free_http_cbdata_common (cbd, FALSE);
+ REF_RELEASE (cbd);
}
/*
@@ -785,6 +786,11 @@ rspamd_map_dns_callback (struct rdns_reply *reply, void *arg)
map = cbd->map;
+ if (cbd->stage == map_finished) {
+ MAP_RELEASE (cbd, "http_callback_data");
+ return;
+ }
+
if (reply->code == RDNS_RC_NOERROR) {
/*
* We just get the first address hoping that a resolver performs
@@ -1346,6 +1352,8 @@ rspamd_map_is_map (const gchar *map_line)
static void
rspamd_map_backend_dtor (struct rspamd_map_backend *bk)
{
+ g_free (bk->uri);
+
if (bk->protocol == MAP_PROTO_FILE) {
if (bk->data.fd) {
g_free (bk->data.fd->filename);
diff --git a/src/libutil/map_private.h b/src/libutil/map_private.h
index 4879d5257..9e24695b5 100644
--- a/src/libutil/map_private.h
+++ b/src/libutil/map_private.h
@@ -116,7 +116,8 @@ enum rspamd_map_http_stage {
map_resolve_host1, /* 1 requests sent */
map_load_file,
map_load_pubkey,
- map_load_signature
+ map_load_signature,
+ map_finished
};
struct map_periodic_cbdata {