]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3920: Splay::remove() reference counting inconsistent
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 19 Jan 2015 14:22:29 +0000 (06:22 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 19 Jan 2015 14:22:29 +0000 (06:22 -0800)
include/splay.h

index 69d6939110847c77c90fd7ad5e37cd18c18637f6..270bcb6e3653933057529ae31c8ce72f6a997185 100644 (file)
@@ -313,7 +313,9 @@ template <class V>
 void
 Splay<V>::remove(Value const &value, SPLAYCMP *compare)
 {
-    assert (find (value, compare));
+    // also catches the head==NULL case
+    if (find(value, compare) == NULL)
+        return;
 
     head = head->remove(value, compare);