/*
- * $Id: fqdncache.cc,v 1.22 1996/10/09 15:34:25 wessels Exp $
+ * $Id: fqdncache.cc,v 1.23 1996/10/10 19:04:14 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
fqdncache_dnsDispatch(dnsData, i);
return 1;
}
+
+void
+fqdncacheFreeMemory(void)
+{
+ fqdncache_entry *f;
+ fqdncache_entry **list;
+ int k = 0;
+ int j;
+ list = xcalloc(meta_data.fqdncache_count, sizeof(fqdncache_entry *));
+ f = (fqdncache_entry *) hash_first(fqdn_table);
+ while (f && k < meta_data.fqdncache_count) {
+ *(list + k) = f;
+ k++;
+ f = (fqdncache_entry *) hash_next(fqdn_table);
+ }
+ for (j = 0; j < k; j++) {
+ f = *(list + j);
+ for (k = 0; k < (int) f->name_count; k++)
+ safe_free(f->names[k]);
+ safe_free(f->name);
+ safe_free(f->error_message);
+ safe_free(f);
+ }
+ xfree(list);
+ hashFreeMemory(fqdn_table);
+}
+
/*
- * $Id: ipcache.cc,v 1.68 1996/10/09 22:49:37 wessels Exp $
+ * $Id: ipcache.cc,v 1.69 1996/10/10 19:04:16 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
if (ia->cur >= ia->count)
ia->cur = 0;
}
+
+void
+ipcacheFreeMemory(void)
+{
+ ipcache_entry *i;
+ ipcache_entry **list;
+ int k = 0;
+ int j;
+ list = xcalloc(meta_data.ipcache_count, sizeof(ipcache_entry *));
+ i = (ipcache_entry *) hash_first(ip_table);
+ while (i && k < meta_data.ipcache_count) {
+ *(list + k) = i;
+ k++;
+ i = (ipcache_entry *) hash_next(ip_table);
+ }
+ for (j = 0; j < k; j++) {
+ i = *(list + j);
+ safe_free(i->addrs.in_addrs);
+ safe_free(i->name);
+ safe_free(i->error_message);
+ safe_free(i);
+ }
+ xfree(list);
+ hashFreeMemory(ip_table);
+}
int i = 0;
int j;
- L1 = xcalloc(meta_data.netdb_addrs, sizeof(netdbEntry));
+ L1 = xcalloc(meta_data.netdb_addrs, sizeof(netdbEntry *));
n = (netdbEntry *) hash_first(addr_table);
while (n && i < meta_data.netdb_addrs) {
*(L1 + i) = n;
xfree(L1);
i = 0;
- L2 = xcalloc(meta_data.netdb_hosts, sizeof(netdbEntry));
+ L2 = xcalloc(meta_data.netdb_hosts, sizeof(hash_link *));
h = hash_first(host_table);
while (h && i < meta_data.netdb_hosts) {
*(L2 + i) = h;
/*
- * $Id: store.cc,v 1.128 1996/10/10 18:52:23 wessels Exp $
+ * $Id: store.cc,v 1.129 1996/10/10 19:04:19 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
StoreEntry **list;
int i = 0;
int j;
- list = xcalloc(meta_data.store_entries, sizeof(StoreEntry));
+ list = xcalloc(meta_data.store_entries, sizeof(StoreEntry *));
e = (StoreEntry *) hash_first(store_table);
while (e && i < meta_data.store_entries) {
*(list + i) = e;
/*
- * $Id: tools.cc,v 1.68 1996/10/09 22:49:44 wessels Exp $
+ * $Id: tools.cc,v 1.69 1996/10/10 19:04:20 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
errorpageFreeMemory();
stmemFreeMemory();
netdbFreeMemory();
+ ipcacheFreeMemory();
+ fqdncacheFreeMemory();
debug(21, 0, "Squid Cache (Version %s): Exiting normally.\n",
version_string);
exit(0);