From: Amos Jeffries Date: Sat, 6 Oct 2012 02:27:30 +0000 (-0600) Subject: Bug 3661: Segmentation fault when using more than 1 worker X-Git-Tag: SQUID_3_2_2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=463c4ad31609b8f8bf868096c9b54376eaf1c476;p=thirdparty%2Fsquid.git Bug 3661: Segmentation fault when using more than 1 worker Previous change to Ipc::Mem::PageStack making variable arrays into dynamically-allocated arrays added an allocate after use bug. --- diff --git a/src/ipc/mem/PageStack.cc b/src/ipc/mem/PageStack.cc index 25d8497507..fea71d272b 100644 --- a/src/ipc/mem/PageStack.cc +++ b/src/ipc/mem/PageStack.cc @@ -20,10 +20,10 @@ Ipc::Mem::PageStack::PageStack(const uint32_t aPoolId, const unsigned int aCapac theSize(theCapacity), theLastReadable(prev(theSize)), theFirstWritable(next(theLastReadable)) { + theItems=new Item[theSize]; // initially, all pages are free for (Offset i = 0; i < theSize; ++i) theItems[i] = i + 1; // skip page number zero to keep numbers positive - theItems=new Item[theSize]; } Ipc::Mem::PageStack::~PageStack()