]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla #162
authorhno <>
Fri, 15 Jun 2001 01:15:04 +0000 (01:15 +0000)
committerhno <>
Fri, 15 Jun 2001 01:15:04 +0000 (01:15 +0000)
Fix for a small memory leak when delay_pools is configured to 0 (default)

src/cache_cf.cc

index cacabe44a2cbeb9d60913521054ee17e39315133..a2e10563d9488d2d6b153a95607ab271d53f0267 100644 (file)
@@ -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