]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
streaming: remove dead code
authorVictor Julien <vjulien@oisf.net>
Wed, 25 Jan 2023 10:58:11 +0000 (11:58 +0100)
committerVictor Julien <vjulien@oisf.net>
Wed, 25 Jan 2023 11:29:53 +0000 (12:29 +0100)
As reported by Coverity Scan.

src/util-streaming-buffer.c

index c1cc515028c1f0e2c4d1f8ca412a245b1853bee6..b704a62ef988506da609c9bd5b212b9b98bd9e60 100644 (file)
@@ -1063,10 +1063,7 @@ static StreamingBufferRegion *FindLargestRegionForOffset(const StreamingBuffer *
         if (!RegionsIntersect(sb, cfg, r, offset, data_re))
             return candidate;
 
-        if (candidate == NULL) {
-            candidate = r;
-            SCLogDebug("candidate %p", candidate);
-        } else if (r->buf_size > candidate->buf_size) {
+        if (r->buf_size > candidate->buf_size) {
             SCLogDebug("candidate %p as size %u > %u", candidate, r->buf_size, candidate->buf_size);
             candidate = r;
         }