]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3760: fix typo in earlier patch
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Jan 2015 22:11:24 +0000 (14:11 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Jan 2015 22:11:24 +0000 (14:11 -0800)
src/ip/Address.cc

index 88d0723e57b8d843759f8c681c7e58b22edb1d15..59942d1151c48297cffd6aa0ceec9190638f672c 100644 (file)
@@ -393,6 +393,7 @@ Ip::Address::lookupHostIP(const char *s, bool nodns)
         return false;
     }
 
+    struct addrinfo *resHead = res; // we need to free the whole list later
     if (!Ip::EnableIpv6) {
         // if we are IPv6-disabled, use first-IPv4 instead of first-IP.
         struct addrinfo *maybeIpv4 = res;
@@ -415,7 +416,7 @@ Ip::Address::lookupHostIP(const char *s, bool nodns)
     port(portSaved);
 
     /* free the memory getaddrinfo() dynamically allocated. */
-    freeaddrinfo(res);
+    freeaddrinfo(resHead);
     return true;
 }