From: hno <> Date: Thu, 17 Oct 2002 08:11:23 +0000 (+0000) Subject: Fix a misunderstanding in how delay pools are allocated. Thanks to David Luyer X-Git-Tag: SQUID_3_0_PRE1~634 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb1b7d4d6f8a85dbf088a1c639ce6baa8776a8e1;p=thirdparty%2Fsquid.git Fix a misunderstanding in how delay pools are allocated. Thanks to David Luyer for noticing the error and explaining what the code is meant to do. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 234acac98c..4b7524ea02 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.419 2002/10/14 08:43:46 hno Exp $ + * $Id: cache_cf.cc,v 1.420 2002/10/17 02:11:23 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -900,7 +900,8 @@ parse_delay_pool_class(delayConfig * cfg) delayFreeDelayPool(pool); safe_free(cfg->rates[pool]); } - cfg->rates[pool] = (delaySpecSet *)xmalloc(delay_class * sizeof(delaySpecSet)); + /* Allocates a "delaySpecSet" just as large as needed for the class */ + cfg->rates[pool] = (delaySpecSet *)xmalloc(delay_class * sizeof(delaySpec)); cfg->delay_class[pool] = delay_class; cfg->rates[pool]->aggregate.restore_bps = cfg->rates[pool]->aggregate.max_bytes = -1; if (cfg->delay_class[pool] >= 3)