From: Aki Tuomi Date: Fri, 23 May 2025 18:07:33 +0000 (+0300) Subject: lib-master: Copy haproxy provided fields before calling callback X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=888ff933db9c7ea5393d6ef83cbb11b6de94ca5e;p=thirdparty%2Fdovecot%2Fcore.git lib-master: Copy haproxy provided fields before calling callback Otherwise fields get lost, broken in 894610212596c35aade07a4d0af9d5e7fd6245c7 --- diff --git a/src/lib-master/master-service-haproxy.c b/src/lib-master/master-service-haproxy.c index d312b89e55..e5cf4254ea 100644 --- a/src/lib-master/master-service-haproxy.c +++ b/src/lib-master/master-service-haproxy.c @@ -139,6 +139,14 @@ master_service_haproxy_conn_success(struct master_service_haproxy_conn *hpconn) struct master_service *service = hpconn->service; struct master_service_connection conn = hpconn->conn; + /* copy values */ + conn.haproxy.cert_common_name = t_strdup(hpconn->conn.haproxy.cert_common_name); + if (hpconn->conn.haproxy.alpn_size > 0) + conn.haproxy.alpn = t_memdup(hpconn->conn.haproxy.alpn, hpconn->conn.haproxy.alpn_size); + else + conn.haproxy.alpn = NULL; + conn.haproxy.hostname = t_strdup(hpconn->conn.haproxy.hostname); + master_service_haproxy_conn_free(hpconn); master_service_client_connection_callback(service, &conn); }