]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Kill useless use of goto
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 1 Dec 2008 05:08:54 +0000 (18:08 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 1 Dec 2008 05:08:54 +0000 (18:08 +1300)
src/tools.cc

index 494dc7ab6ce146ca87ca7b6092ae8368aea2798b..c6470d04be831d80e0c363a949f35280e8e65fa3 100644 (file)
@@ -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);