]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Check that StoreEntry lock does not go negative
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 27 Dec 2013 18:34:41 +0000 (11:34 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 27 Dec 2013 18:34:41 +0000 (11:34 -0700)
which may happen if unlocked (and possibly deleted) entry is unlocked (again).

src/store.cc

index 3dcff35f795f4fa13fa2bbdcfa045a38e65424bc..3373b13557a58e04150d631736d57883a00d273d 100644 (file)
@@ -542,6 +542,7 @@ StoreEntry::unlock(const char *context)
 {
     debugs(20, 3, (context ? context : "somebody") <<
            " unlocking key " << getMD5Text() << ' ' << *this);
+    assert(lock_count > 0);
     --lock_count;
 
     if (lock_count)