BUILD: listener: shut report of possible null-deref in listener_accept()
When building without threads, gcc 12 says that there's a null-deref in _HA_ATOMIC_INC() called from listener_accept(). It's just that the code was originally written in an attempt not to always have a proxy for a listener and that there are two places where the pointer is tested before being used, so the compiler concludes that the pointer might be null hence that other places are null-derefs. In practice the pointer cannot be null there (and never has been), but since that code was initially built that way and it's only a matter of adding a pair of braces to shut it up, let's respect that initial attempt in case one day we need it. This one was also reported by Ilya in issue #1513, though with threads enabled in his case. This may have to be backported if users complain about new breakage with gcc-12.
This commit is contained in:
parent
8a0fd3a36c
commit
d86793479f
@ -964,10 +964,10 @@ void listener_accept(struct listener *l)
|
||||
if (l->counters)
|
||||
HA_ATOMIC_UPDATE_MAX(&l->counters->conn_max, next_conn);
|
||||
|
||||
if (p)
|
||||
if (p) {
|
||||
HA_ATOMIC_UPDATE_MAX(&p->fe_counters.conn_max, next_feconn);
|
||||
|
||||
proxy_inc_fe_conn_ctr(l, p);
|
||||
proxy_inc_fe_conn_ctr(l, p);
|
||||
}
|
||||
|
||||
if (!(l->options & LI_O_UNLIMITED)) {
|
||||
count = update_freq_ctr(&global.conn_per_sec, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user