From 6b9c3d06217b34145ea28c05c5395d736b7448f9 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 14 Nov 2025 13:46:00 +0100 Subject: [PATCH] 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. --- src/peers.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.47.3