From 1ef724e2169eaff7f0272278c3fba9b34d5c7f78 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 12 Feb 2019 10:59:32 +0100 Subject: [PATCH] BUILD/MINOR: stream: avoid a build warning with threads disabled gcc 6+ complains about a possible null-deref here due to the test in objt_server() : if (objt_server(s->target)) HA_ATOMIC_ADD(&objt_server(s->target)->counters.retries, 1); Let's simply change it to __objt_server(). This can be backported to 1.9 and 1.8. --- src/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index df778b156..a58c85530 100644 --- a/src/stream.c +++ b/src/stream.c @@ -793,7 +793,7 @@ static int sess_update_st_cer(struct stream *s) si->state = SI_ST_REQ; } else { if (objt_server(s->target)) - HA_ATOMIC_ADD(&objt_server(s->target)->counters.retries, 1); + HA_ATOMIC_ADD(&__objt_server(s->target)->counters.retries, 1); HA_ATOMIC_ADD(&s->be->be_counters.retries, 1); si->state = SI_ST_ASS; }