From: robertc <> Date: Mon, 23 Jun 2003 16:07:36 +0000 (+0000) Subject: Summary: Fix race condition in storeUnlockObject. X-Git-Tag: SQUID_3_0_PRE1~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42fc2858a400d70a4b859f0c16fbe9aa1798a4b0;p=thirdparty%2Fsquid.git Summary: Fix race condition in storeUnlockObject. Keywords: storeUnlockObject would, under rare circumstances free the object it is unlocking, and -then- attempt to reference it. --- diff --git a/src/store.cc b/src/store.cc index df058d9b2b..e57a7f476e 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.566 2003/05/18 00:04:07 robertc Exp $ + * $Id: store.cc,v 1.567 2003/06/23 10:07:36 robertc Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -463,11 +463,13 @@ storeUnlockObject(StoreEntry * e) storeSetMemStatus(e, IN_MEMORY); e->mem_obj->unlinkRequest(); } else { - storePurgeMem(e); storeEntryDereferenced(e); if (EBIT_TEST(e->flags, KEY_PRIVATE)) debug(20, 1) ("WARNING: %s:%d: found KEY_PRIVATE\n", __FILE__, __LINE__); + + /* storePurgeMem may free e */ + storePurgeMem(e); } return 0;