]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
MemStore::unlink() should not assume that the entry is "linked"
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 9 Jul 2013 22:48:05 +0000 (16:48 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 9 Jul 2013 22:48:05 +0000 (16:48 -0600)
because the caller should not be responsible for knowing how that linking works.

src/MemStore.cc

index 29ba17346512ea946d1e3994c8fe21e96b7df2cf..1cdf3a100d081ac33bb48b7155abe7145f284ce1 100644 (file)
@@ -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 {