From: wessels <> Date: Fri, 15 May 1998 20:35:48 +0000 (+0000) Subject: FUM errors. we're accessing 'sc' after it gets freed by a callback. X-Git-Tag: SQUID_3_0_PRE1~3319 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a455c0975a3194c22088b1a206d223edf8050697;p=thirdparty%2Fsquid.git FUM errors. we're accessing 'sc' after it gets freed by a callback. Wrapping storeClientCopy2() with cbdataLock/Unlock should prevent it from being freed until the end of this function. Gross solution. --- diff --git a/src/store_client.cc b/src/store_client.cc index f02121a3bb..23dd326597 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -143,6 +143,7 @@ storeClientCopy2(StoreEntry * e, store_client * sc) eventAdd("storeClientCopyEvent", storeClientCopyEvent, sc, 0, 0); return; } + cbdataLock(sc); /* ick, prevent sc from getting freed */ sc->flags.store_copying = 1; debug(20, 3) ("storeClientCopy2: %s\n", storeKeyText(e->key)); assert(callback != NULL); @@ -211,6 +212,7 @@ storeClientCopy2(StoreEntry * e, store_client * sc) } } sc->flags.store_copying = 0; + cbdataUnlock(sc); /* ick, allow sc to be freed */ } static void