]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Fix storing dns_client_socket_path to http_client_context
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 25 Jul 2023 07:17:01 +0000 (10:17 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:09 +0000 (12:34 +0200)
It wasn't safe to point it directly to http_client's settings, since the
client could become destroyed.

src/lib-http/http-client.c

index 5722d95f8dea82eb88170a2a4e2e1aef6b47f91c..e5f40ea3fe3e3bff55db38b9dc0c23611318b300 100644 (file)
@@ -541,7 +541,7 @@ http_client_context_update_settings(struct http_client_context *cctx)
                    client->set->dns_client_socket_path != NULL &&
                    client->set->dns_client_socket_path[0] != '\0') {
                        cctx->dns_client_socket_path =
-                               client->set->dns_client_socket_path;
+                               p_strdup(cctx->pool, client->set->dns_client_socket_path);
                }
                if (client->set->dns_ttl_msecs != 0 &&
                    cctx->dns_ttl_msecs > client->set->dns_ttl_msecs)