X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fhost.c;h=11de5944352d91d6b805b8bc00ad832ee8097ca3;hp=aecefabaa9b76c491c26c80988e9cc23d5c49c86;hb=4d7c5e087b2bc82c9f503dff003916d1047903ce;hpb=335f7a4f924bff3cf0d0028b5c81efe14051e399 diff --git a/src/host.c b/src/host.c index aecefaba..11de5944 100644 --- a/src/host.c +++ b/src/host.c @@ -1,11 +1,11 @@ /* Host name resolution and matching. - Copyright (C) 1996-2005 Free Software Foundation, Inc. + Copyright (C) 1996-2006 Free Software Foundation, Inc. This file is part of GNU Wget. GNU Wget is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or +the Free Software Foundation; either version 3 of the License, or (at your option) any later version. GNU Wget is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Wget; if not, write to the Free Software Foundation, Inc., -51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +along with Wget. If not, see . In addition, as a special exception, the Free Software Foundation gives permission to link the code of its release of Wget with the @@ -857,26 +856,22 @@ sufmatch (const char **list, const char *what) return false; } -static int -host_cleanup_mapper (void *key, void *value, void *arg_ignored) -{ - struct address_list *al; - - xfree (key); /* host */ - - al = (struct address_list *)value; - assert (al->refcount == 1); - address_list_delete (al); - - return 0; -} - void host_cleanup (void) { if (host_name_addresses_map) { - hash_table_map (host_name_addresses_map, host_cleanup_mapper, NULL); + hash_table_iterator iter; + for (hash_table_iterate (host_name_addresses_map, &iter); + hash_table_iter_next (&iter); + ) + { + char *host = iter.key; + struct address_list *al = iter.value; + xfree (host); + assert (al->refcount == 1); + address_list_delete (al); + } hash_table_destroy (host_name_addresses_map); host_name_addresses_map = NULL; }