]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: dns: resolution can never be null
authorWilliam Dauchy <w.dauchy@criteo.com>
Wed, 27 Nov 2019 22:32:41 +0000 (23:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Nov 2019 19:41:46 +0000 (20:41 +0100)
`eb` being tested above, `res` cannot be null, so the condition is
not needed and introduces potential dead code.

also fix a typo in associated comment

This should fix issue #349

Reported-by: Ð\98лÑ\8cÑ\8f ШипиÑ\86ин <chipitsine@gmail.com>
Signed-off-by: William Dauchy <w.dauchy@criteo.com>
src/dns.c

index 6e726bf961cd00bf4eef74acb93457425d3a826e..c52f1cabeff7deb50074232b000f2b89161f5dad 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -1577,13 +1577,8 @@ static void dns_resolve_recv(struct dgram_conn *dgram)
                        continue;
                }
 
-               /* known query id means a resolution in prgress */
+               /* known query id means a resolution in progress */
                res = eb32_entry(eb, struct dns_resolution, qid);
-               if (!res) {
-                       ns->counters.outdated++;
-                       continue;
-               }
-
                /* number of responses received */
                res->nb_responses++;