]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove some NULL references from adaptation/icap/ModXact.cc
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 2 Mar 2017 11:52:42 +0000 (00:52 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 2 Mar 2017 11:52:42 +0000 (00:52 +1300)
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

index 70646935aeec5c842da373952a22880b8fc41a74..153e8fa8e4d5892f158fa6816cb8471feaa0e609 100644 (file)
@@ -966,7 +966,7 @@ void Adaptation::Icap::ModXact::prepEchoing()
         } else if (dynamic_cast<const HttpReply*>(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