From: wessels <> Date: Mon, 7 Oct 1996 20:40:09 +0000 (+0000) Subject: coredump fix in storeFreeMemory() X-Git-Tag: SQUID_3_0_PRE1~5719 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea6b05e3e88c454f079c5c6cb4bc3e097edcbe30;p=thirdparty%2Fsquid.git coredump fix in storeFreeMemory() --- diff --git a/src/store.cc b/src/store.cc index e62b6c1e9a..0f6e78f608 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.123 1996/09/26 19:54:48 wessels Exp $ + * $Id: store.cc,v 1.124 1996/10/07 14:40:09 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -2849,6 +2849,7 @@ storeFreeMemory(void) StoreEntry *e; StoreEntry **list; int i = 0; + int j; list = xcalloc(meta_data.store_entries, sizeof(StoreEntry)); e = (StoreEntry *) hash_first(store_table); while (e && i < meta_data.store_entries) { @@ -2856,10 +2857,8 @@ storeFreeMemory(void) i++; e = (StoreEntry *) hash_next(store_table); } - while (i) { - destroy_StoreEntry(*(list + i)); - i--; - } + for (j = 0; j < i; j++) + destroy_StoreEntry(*(list + j)); xfree(list); hashFreeMemory(store_table); }