From: Alex Rousskov Date: Fri, 18 Dec 2015 12:50:46 +0000 (+1300) Subject: Fix startup crash with a misconfigured (too-small) shared memory cache X-Git-Tag: SQUID_3_5_13~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dabd0fe2a0b25739cd6dac03d464479735df0c38;p=thirdparty%2Fsquid.git Fix startup crash with a misconfigured (too-small) shared memory cache 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. --- diff --git a/src/MemStore.cc b/src/MemStore.cc index a53ecf6346..d4bc939448 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -725,7 +725,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)); }