mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-26 19:22:57 -04:00
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:
parent
bb5c18ab74
commit
ace19fd638
1 changed files with 1 additions and 0 deletions
|
|
@ -913,6 +913,7 @@ static int dns_session_init(struct appctx *appctx)
|
|||
return 0;
|
||||
|
||||
error:
|
||||
sockaddr_free(&addr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue