From: Amos Jeffries Date: Thu, 2 Mar 2017 11:52:42 +0000 (+1300) Subject: Remove some NULL references from adaptation/icap/ModXact.cc X-Git-Tag: SQUID_4_0_19~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b357670a32ccea73a42d4ef2fa0f94513d48081e;p=thirdparty%2Fsquid.git Remove some NULL references from adaptation/icap/ModXact.cc The issue is that Coverity Scan gets confused by implicit casting of NULL to a Pointer into thinking that 'true' comparison is possible when NULL is involved. The != should still compile to the correct checks. Coverity Scan issue 1364725. --- diff --git a/src/adaptation/icap/ModXact.cc b/src/adaptation/icap/ModXact.cc index 70646935ae..153e8fa8e4 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -966,7 +966,7 @@ void Adaptation::Icap::ModXact::prepEchoing() } else if (dynamic_cast(oldHead)) { newHead = new HttpReply; } - Must(newHead != NULL); + Must(newHead); newHead->inheritProperties(oldHead); @@ -1558,12 +1558,11 @@ void Adaptation::Icap::ModXact::encapsulateHead(MemBuf &icapBuf, const char *sec new_reply->sline = old_reply->sline; headClone = new_reply.getRaw(); } - Must(headClone != NULL); + Must(headClone); headClone->inheritProperties(head); HttpHeaderPos pos = HttpHeaderInitPos; - HttpHeaderEntry* p_head_entry = NULL; - while (NULL != (p_head_entry = head->header.getEntry(&pos)) ) + while (HttpHeaderEntry* p_head_entry = head->header.getEntry(&pos)) headClone->header.addEntry(p_head_entry->clone()); // end cloning