]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dns: Assign client to context
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 25 Nov 2022 13:06:27 +0000 (15:06 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 30 Nov 2022 06:28:49 +0000 (08:28 +0200)
Fixes signal 11 crash when background cache refresh fails, forgotten in
47f44374201e83ade6204bb237b163fbd066134a

src/lib-dns/dns-lookup.c

index 393015f2122fb571f4b744a7e4c22bab33dcd785..09504fb3e4863df558a17f652a4f168623237e8b 100644 (file)
@@ -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,