]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed an idnsGrokReply memory leak when merging DNS AAAA and A answers.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 10 Sep 2010 22:01:36 +0000 (16:01 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 10 Sep 2010 22:01:36 +0000 (16:01 -0600)
We were not updating message->ancount after force-feeding the A message
with answers from the old AAAA message.

src/dns_internal.cc

index b2668dc477586c8c8c6cefac87f28693d8403d07..e338ccfeaaffd4ba719f4de20786c236993c89cc 100644 (file)
@@ -1106,6 +1106,7 @@ idnsGrokReply(const char *buf, size_t sz)
         safe_free(message->answer);
 
         message->answer = result;
+        message->ancount += q->initial_AAAA.count;
         n += q->initial_AAAA.count;
         q->initial_AAAA.count=0;
     } else if (q->initial_AAAA.count > 0 && n <= 0) {