]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not rely on LateReleaseStack.pop() returning NULL when empty.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 8 Feb 2011 01:58:02 +0000 (18:58 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 8 Feb 2011 01:58:02 +0000 (18:58 -0700)
Current Stack::pop() implementation returns value_type() when empty. This
is probably not guaranteed to work well when value_type is a pointer.

src/store.cc

index 7800e461d6f501872609b297ae32f5779ae4d0a1..19f4c4322e548fab4f26384349f0699d10c24014 100644 (file)
@@ -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! */