]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Marcin Wisnicki <mwisnicki@gmail.com>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 25 Oct 2010 06:40:45 +0000 (00:40 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 25 Oct 2010 06:40:45 +0000 (00:40 -0600)
Bug 3088: dnsserver is segfaulting

src/dnsserver.cc

index 99ffb14337002ec94530d4d4976ce09aa085e915..5a558c5fd59b9280f0abeae13a1f23292d39dea0 100644 (file)
@@ -214,8 +214,10 @@ lookup(const char *buf)
     hints.ai_flags = AI_CANONNAME;
 
     for (;;) {
-        xfreeaddrinfo(AI);
-        AI = NULL;
+        if (AI != NULL) {
+            xfreeaddrinfo(AI);
+            AI = NULL;
+        }
 
         if ( 0 == (res = xgetaddrinfo(buf,NULL,&hints,&AI)) )
             break;