]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Replace assert with NOP action in hash free.
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 23 May 2009 03:20:47 +0000 (15:20 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 23 May 2009 03:20:47 +0000 (15:20 +1200)
This resolves one small coverity itch.
When nothing to free we don't really need to care, we do need to act
safely and not try to actually action the free though.

lib/hash.c

index 0ff9c86a9bcd3eb98d1583ede348262ece138a5e..77ddcaa261ba9b19a0be71c7754dcb18c7d19b63 100644 (file)
@@ -312,7 +312,8 @@ hashFreeItems(hash_table * hid, HASHFREE * free_func)
 void
 hashFreeMemory(hash_table * hid)
 {
-    assert(hid != NULL);
+    if(hid == NULL)
+        return;
     if (hid->buckets)
        xfree(hid->buckets);
     xfree(hid);