]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: dns: fix memory leak of sockaddr in dns_session_init() error path
authorWilly Tarreau <w@1wt.eu>
Thu, 14 May 2026 20:58:46 +0000 (20:58 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 May 2026 13:40:29 +0000 (15:40 +0200)
commitace19fd638e7c273981a72fcebf96a09031fc459
treedaeba00e19105639a652398a4e7bec0d995b0d1f
parentbb5c18ab7444471a762b98f823f2215e9b25f975
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