From: Alex Rousskov Date: Tue, 8 Feb 2011 01:58:02 +0000 (-0700) Subject: Do not rely on LateReleaseStack.pop() returning NULL when empty. X-Git-Tag: take02~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb7e416ebf0be41624aaa4857b7e2414b76ec256;p=thirdparty%2Fsquid.git Do not rely on LateReleaseStack.pop() returning NULL when empty. Current Stack::pop() implementation returns value_type() when empty. This is probably not guaranteed to work well when value_type is a pointer. --- diff --git a/src/store.cc b/src/store.cc index 7800e461d6..19f4c4322e 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1309,7 +1309,7 @@ storeLateRelease(void *unused) } for (i = 0; i < 10; i++) { - e = LateReleaseStack.pop(); + e = LateReleaseStack.count ? LateReleaseStack.pop() : NULL; if (e == NULL) { /* done! */