From: Willy Tarreau Date: Fri, 14 Nov 2025 12:46:00 +0000 (+0100) Subject: CLEANUP: peers: remove an unneeded null check X-Git-Tag: v3.3-dev13~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b9c3d06217b34145ea28c05c5395d736b7448f9;p=thirdparty%2Fhaproxy.git CLEANUP: peers: remove an unneeded null check Coverity reported in GH #3181 that a NULL test was useless, in peers_trace(), which is true since the peer always belongs to a peers section and it was already dereferenced. Let's just remove the test to avoid the confusion. --- diff --git a/src/peers.c b/src/peers.c index 9a97ebb6b..e7074c6af 100644 --- a/src/peers.c +++ b/src/peers.c @@ -449,9 +449,8 @@ static void peers_trace(enum trace_level level, uint64_t mask, chunk_appendf(&trace_buf, "appctx=(%p, .fl=0x%08x, .st0=%d, .st1=%d) ", appctx, appctx->flags, appctx->st0, appctx->st1); - if (peers) - chunk_appendf(&trace_buf, "peers=(.fl=0x%08x, local=%s) ", - peers->flags, peers->local->id); + chunk_appendf(&trace_buf, "peers=(.fl=0x%08x, local=%s) ", + peers->flags, peers->local->id); if (src->verbosity == PEERS_VERB_SIMPLE) return;