]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
coredump fix in storeFreeMemory()
authorwessels <>
Mon, 7 Oct 1996 20:40:09 +0000 (20:40 +0000)
committerwessels <>
Mon, 7 Oct 1996 20:40:09 +0000 (20:40 +0000)
src/store.cc

index e62b6c1e9aa14a662c7f75b1fc8730c6a21414f5..0f6e78f608bbbcbbd61358e710b8e300cc52c001 100644 (file)
@@ -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);
 }