From: Willy Tarreau Date: Thu, 14 May 2026 20:58:46 +0000 (+0000) Subject: BUG/MEDIUM: dns: fix memory leak of sockaddr in dns_session_init() error path X-Git-Tag: v3.4-dev13~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ace19fd638e7c273981a72fcebf96a09031fc459;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: dns: fix memory leak of sockaddr in dns_session_init() error path In dns_session_init(), sockaddr_alloc() allocates 'addr' from the sockaddr pool, but on failure of appctx_finalize_startup() we jump to the error label without calling sockaddr_free(&addr), leaking the allocation. Let's add the missing sockaddr_free() on the error branch. This must be backported to 2.6. --- diff --git a/src/dns.c b/src/dns.c index 58a1b3608..970db6e43 100644 --- a/src/dns.c +++ b/src/dns.c @@ -913,6 +913,7 @@ static int dns_session_init(struct appctx *appctx) return 0; error: + sockaddr_free(&addr); return -1; }