From: Amos Jeffries Date: Mon, 25 Oct 2010 04:14:50 +0000 (-0600) Subject: Author: Marcin Wisnicki X-Git-Tag: take1~145 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8e337c1741db872274ce427671ed64a01394bed;p=thirdparty%2Fsquid.git Author: Marcin Wisnicki Bug 3088: dnsserver is segfaulting --- diff --git a/src/dnsserver.cc b/src/dnsserver.cc index 919b58f1bf..4cde6f0ec5 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -201,8 +201,10 @@ lookup(const char *buf) hints.ai_flags = AI_CANONNAME; for (;;) { - freeaddrinfo(AI); - AI = NULL; + if (AI != NULL) { + freeaddrinfo(AI); + AI = NULL; + } if ( 0 == (res = getaddrinfo(buf,NULL,&hints,&AI)) ) break;