]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: dns: remove 45 "return" statements from dns_validate_dns_response()
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Jul 2020 15:00:45 +0000 (17:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Jul 2020 15:09:20 +0000 (17:09 +0200)
commit963f701f4f8190e6c754f1c95162ec38b2597c4e
treeffa5c739bae81abd37138a530a1d3506ee9b47dc
parent2151cdd38cbc5ae92362ac471f0c9dddd640a802
CLEANUP: dns: remove 45 "return" statements from dns_validate_dns_response()

The previous leak on do-resolve was particularly tricky to check due
to the important code repetition in dns_validate_dns_response() which
required careful examination of all return statements to check whether
they needed a pool_free() or not. Let's clean all this up using a common
leave point which releases the element itself. This also encourages
to properly set the current response to null right after freeing or
adding it so that it doesn't get added. 45 return and 22 pool_free()
were replaced by one of each.
src/dns.c