From: wessels <> Date: Wed, 21 Oct 1998 12:54:18 +0000 (+0000) Subject: memory leaks X-Git-Tag: SQUID_3_0_PRE1~2539 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1fc2a8dcc1f97fa8688b06deb02a4cc7b971c8c;p=thirdparty%2Fsquid.git memory leaks --- diff --git a/src/asn.cc b/src/asn.cc index ff8273eec1..7dd5bf0973 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -1,5 +1,5 @@ /* - * $Id: asn.cc,v 1.49 1998/09/21 06:49:39 wessels Exp $ + * $Id: asn.cc,v 1.50 1998/10/21 06:54:18 wessels Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -148,8 +148,10 @@ void asnInit(void) { extern int max_keylen; + static int inited = 0; max_keylen = 40; - rn_init(); + if (0 == inited++) + rn_init(); rn_inithead((void **) &AS_tree_head, 8); asnAclInitialize(Config.aclList); cachemgrRegister("asndb", "AS Number Database", asnStats, 0, 1); diff --git a/src/event.cc b/src/event.cc index b199dc7ce8..a8c2899f07 100644 --- a/src/event.cc +++ b/src/event.cc @@ -1,6 +1,6 @@ /* - * $Id: event.cc,v 1.22 1998/07/22 20:37:17 wessels Exp $ + * $Id: event.cc,v 1.23 1998/10/21 06:54:21 wessels Exp $ * * DEBUG: section 41 Event Processing * AUTHOR: Henrik Nordstrom @@ -174,3 +174,15 @@ eventDump(StoreEntry * sentry) e = e->next; } } + +void +eventFreeMemory(void) +{ + struct ev_entry *event; + while ((event = tasks)) { + if (NULL != event->arg) + cbdataUnlock(event->arg); + xfree(event); + } + tasks = NULL; +} diff --git a/src/main.cc b/src/main.cc index e6fbe95cac..3452e85ad1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.273 1998/10/10 14:57:41 wessels Exp $ + * $Id: main.cc,v 1.274 1998/10/21 06:54:19 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -723,6 +723,7 @@ SquidShutdown(void *unused) clientdbFreeMemory(); httpHeaderCleanModule(); statFreeMemory(); + eventFreeMemory(); #endif memClean(); #if !XMALLOC_TRACE diff --git a/src/protos.h b/src/protos.h index 1265d1caba..8ab9fe0801 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.281 1998/10/17 04:34:11 rousskov Exp $ + * $Id: protos.h,v 1.282 1998/10/21 06:54:20 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -107,7 +107,7 @@ extern int cbdataValid(const void *p); extern void cbdataDump(StoreEntry *); extern void clientdbInit(void); -extern void clientdbUpdate(struct in_addr, log_type, protocol_t, size_t); +extern void clientdbUpdate(struct in_addr, log_type, protocol_t, size_t, request_flags); extern int clientdbCutoffDenied(struct in_addr); extern void clientdbDump(StoreEntry *); extern void clientdbFreeMemory(void); @@ -213,6 +213,7 @@ extern void eventRun(void); extern time_t eventNextTime(void); extern void eventDelete(EVH * func, void *arg); extern void eventInit(void); +extern void eventFreeMemory(void); extern void fd_close(int fd); extern void fd_open(int fd, unsigned int type, const char *);