From b357670a32ccea73a42d4ef2fa0f94513d48081e Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 3 Mar 2017 00:52:42 +1300 Subject: [PATCH] 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. --- src/adaptation/icap/ModXact.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 -- 2.47.3