]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD/MINOR: stream: avoid a build warning with threads disabled
authorWilly Tarreau <w@1wt.eu>
Tue, 12 Feb 2019 09:59:32 +0000 (10:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 12 Feb 2019 09:59:32 +0000 (10:59 +0100)
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

index df778b156b6bed423f2413cfee33a891cefac98c..a58c8553005ce87628f4d6fa64833827e08ff79f 100644 (file)
@@ -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;
        }