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.
This commit is contained in:
Willy Tarreau 2026-05-14 20:58:46 +00:00
parent bb5c18ab74
commit ace19fd638

View file

@ -913,6 +913,7 @@ static int dns_session_init(struct appctx *appctx)
return 0;
error:
sockaddr_free(&addr);
return -1;
}