From ace19fd638e7c273981a72fcebf96a09031fc459 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 14 May 2026 20:58:46 +0000 Subject: [PATCH] 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. --- src/dns.c | 1 + 1 file changed, 1 insertion(+) 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; }