From: Amos Jeffries Date: Sat, 23 May 2009 03:20:47 +0000 (+1200) Subject: Replace assert with NOP action in hash free. X-Git-Tag: SQUID_3_0_STABLE16~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dfd59e8057e242d5d0f6389a263775c9e789704;p=thirdparty%2Fsquid.git Replace assert with NOP action in hash free. 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. --- diff --git a/lib/hash.c b/lib/hash.c index 0ff9c86a9b..77ddcaa261 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -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);