From 5b675efaef119656d5997f0b67cf9e620eb1765a Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Thu, 17 Dec 2015 21:30:52 -0700 Subject: [PATCH] Squid with a misconfigured (too-small) shared memory cache might crash upon startup. Controller condition for allocating MemStore is slightly different from MemStore condition for allocating MemStore::map, resulting in MemStore without a map. Until that discrepancy is fixed, be careful when dereferencing MemStore::map. --- src/MemStore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MemStore.cc b/src/MemStore.cc index a23325005d..f30d2c4ddf 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -705,7 +705,7 @@ MemStore::unlink(StoreEntry &e) if (e.mem_obj && e.mem_obj->memCache.index >= 0) { map->freeEntry(e.mem_obj->memCache.index); disconnect(e); - } else { + } else if (map) { // the entry may have been loaded and then disconnected from the cache map->freeEntryByKey(reinterpret_cast(e.key)); } -- 2.47.3