From d9e6b3570140ca0cb4f8e1804ae36b490f2dbfaf Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 15 Nov 2021 09:40:57 +0100 Subject: [PATCH] CLEANUP: peers: Remove useless test on peer variable in peer_trace() A useless test on peer variable was reported by cppcheck in peer_trace(). This patch should fix the issue #1165. --- src/peers.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/peers.c b/src/peers.c index 94ef22e684..5cd2f74580 100644 --- a/src/peers.c +++ b/src/peers.c @@ -443,7 +443,7 @@ static void peers_trace(enum trace_level level, uint64_t mask, const struct peer *peer = a2; struct peers *peers = NULL; - if (peer && peer->appctx) { + if (peer->appctx) { struct stream_interface *si; si = peer->appctx->owner; @@ -456,8 +456,7 @@ static void peers_trace(enum trace_level level, uint64_t mask, if (peers) chunk_appendf(&trace_buf, " %s", peers->local->id); - if (peer) - chunk_appendf(&trace_buf, " -> %s", peer->id); + chunk_appendf(&trace_buf, " -> %s", peer->id); } if (a3) {