From 09b5e715ada13e18c2aa6dfc07de87b5908e711f Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Fri, 25 Nov 2022 15:06:27 +0200 Subject: [PATCH] lib-dns: Assign client to context Fixes signal 11 crash when background cache refresh fails, forgotten in 47f44374201e83ade6204bb237b163fbd066134a --- src/lib-dns/dns-lookup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib-dns/dns-lookup.c b/src/lib-dns/dns-lookup.c index 393015f212..09504fb3e4 100644 --- a/src/lib-dns/dns-lookup.c +++ b/src/lib-dns/dns-lookup.c @@ -170,6 +170,7 @@ static void dns_client_cache_entry_refresh(struct dns_client *client, i_unreached(); ctx = i_new(struct dns_cache_lookup, 1); ctx->key = i_strdup(entry->cache_key); + ctx->client = client; if (dns_client_lookup_ptr(client, &ip, client->conn.event, dns_client_cache_callback, ctx, &lookup) < 0) { @@ -185,6 +186,7 @@ static void dns_client_cache_entry_refresh(struct dns_client *client, } else if (*entry->cache_key == 'N') { ctx = i_new(struct dns_cache_lookup, 1); ctx->key = i_strdup(entry->cache_key); + ctx->client = client; if (dns_client_lookup(client, entry->cache_key + 1, client->conn.event, dns_client_cache_callback, -- 2.47.3