From: Michael Tremer Date: Sun, 26 Oct 2025 17:58:23 +0000 (+0000) Subject: sources: iptables: Make the static analyzer happy X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45d02ac6640ffe97b035eea7c2f9da9f51ef373e;p=collecty.git sources: iptables: Make the static analyzer happy Signed-off-by: Michael Tremer --- diff --git a/src/daemon/sources/iptables.c b/src/daemon/sources/iptables.c index 8c90df3..19fcc10 100644 --- a/src/daemon/sources/iptables.c +++ b/src/daemon/sources/iptables.c @@ -146,6 +146,11 @@ static int iptables_iterate_matches(td_ctx* ctx, td_source* source, if (r < 0) return r; + // Skip if no comment was found. This will never happen and + // is only here to make the static analyzer happy. + if (unlikely(!c)) + continue; + // Increment counters c->packets += rule->counters.pcnt; c->bytes += rule->counters.bcnt;