From: Alex Rousskov Date: Tue, 9 Jul 2013 22:48:05 +0000 (-0600) Subject: MemStore::unlink() should not assume that the entry is "linked" X-Git-Tag: SQUID_3_5_0_1~444^2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e41a207fffd3318e0f0ee8beffea2361d3ac8ca8;p=thirdparty%2Fsquid.git MemStore::unlink() should not assume that the entry is "linked" because the caller should not be responsible for knowing how that linking works. --- diff --git a/src/MemStore.cc b/src/MemStore.cc index 29ba173465..1cdf3a100d 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -698,8 +698,7 @@ MemStore::markForUnlink(StoreEntry &e) void MemStore::unlink(StoreEntry &e) { - assert(e.mem_obj); - if (e.mem_obj->memCache.index >= 0) { + if (e.mem_obj && e.mem_obj->memCache.index >= 0) { map->freeEntry(e.mem_obj->memCache.index); disconnect(e); } else {