From: hno <> Date: Fri, 15 Jun 2001 01:15:04 +0000 (+0000) Subject: Bugzilla #162 X-Git-Tag: SQUID_3_0_PRE1~1493 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1781dfc0810cfdb7d2ea1b4fa5f073ee046e016e;p=thirdparty%2Fsquid.git Bugzilla #162 Fix for a small memory leak when delay_pools is configured to 0 (default) --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index cacabe44a2..a2e10563d9 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.384 2001/06/01 09:06:57 hno Exp $ + * $Id: cache_cf.cc,v 1.385 2001/06/14 19:15:04 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -685,10 +685,12 @@ parse_delay_pool_count(delayConfig * cfg) free_delay_pool_count(cfg); } parse_ushort(&cfg->pools); - delayInitDelayData(cfg->pools); - cfg->class = xcalloc(cfg->pools, sizeof(u_char)); - cfg->rates = xcalloc(cfg->pools, sizeof(delaySpecSet *)); - cfg->access = xcalloc(cfg->pools, sizeof(acl_access *)); + if (cfg->pools) { + delayInitDelayData(cfg->pools); + cfg->class = xcalloc(cfg->pools, sizeof(u_char)); + cfg->rates = xcalloc(cfg->pools, sizeof(delaySpecSet *)); + cfg->access = xcalloc(cfg->pools, sizeof(acl_access *)); + } } static void