Repository: trafficserver
Updated Branches:
  refs/heads/master 2b021b080 -> a477ad721


TS-3287 Add a consistency check on cache initialization.

This is probably something that can't happen, but the test is
reasonable, and makes Coverity #CID 1022176 happy.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a477ad72
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a477ad72
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a477ad72

Branch: refs/heads/master
Commit: a477ad72196d40041f85772dd19be9e76cc31ddf
Parents: 2b021b0
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Jan 14 17:13:03 2015 -0800
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed Jan 14 17:13:03 2015 -0800

----------------------------------------------------------------------
 iocore/cache/Cache.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a477ad72/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index c0b73b2..50b2fc7 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -2060,7 +2060,7 @@ build_vol_hash_table(CacheHostRecord *cp)
 
   num_vols -= bad_vols;
 
-  if (!num_vols) {
+  if (!num_vols || !total) {
     // all the disks are corrupt,
     if (cp->vol_hash_table) {
       new_Freer(cp->vol_hash_table, CACHE_MEM_FREE_TIMEOUT);

Reply via email to