From: Amos Jeffries Date: Mon, 1 Dec 2008 05:08:54 +0000 (+1300) Subject: Kill useless use of goto X-Git-Tag: SQUID_3_2_0_1~1313 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=f6a72b331cf93bb573736762f43281fab9caea62;p=thirdparty%2Fsquid.git Kill useless use of goto --- diff --git a/src/tools.cc b/src/tools.cc index 494dc7ab6c..c6470d04be 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1148,18 +1148,21 @@ parseEtcHosts(void) host = lt; } - if (ipcacheAddEntryFromHosts(host, addr) != 0) - goto skip; /* invalid address, continuing is useless */ - + if (ipcacheAddEntryFromHosts(host, addr) != 0) { + /* invalid address, continuing is useless */ + wordlistDestroy(&hosts); + hosts = NULL; + break; + } wordlistAdd(&hosts, host); lt = nt + 1; } - fqdncacheAddEntryFromHosts(addr, hosts); - -skip: - wordlistDestroy(&hosts); + if(hosts) { + fqdncacheAddEntryFromHosts(addr, hosts); + wordlistDestroy(&hosts); + } } fclose (fp);