mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
[BUG] counters: fix segfault on missing counters for a listener
If a frontend does not set 'option socket-stats', a 'clear counters' on the stats socket could segfault because li->counters is NULL. The correct fix is to check for NULL before as this is a valid situation.
This commit is contained in:
parent
6f61b21524
commit
ba255bc3c8
1 changed files with 2 additions and 1 deletions
|
|
@ -317,7 +317,8 @@ int stats_sock_parse_request(struct stream_interface *si, char *line)
|
|||
memset(&sv->counters, 0, sizeof(sv->counters));
|
||||
|
||||
for (li = px->listen; li; li = li->next)
|
||||
memset(li->counters, 0, sizeof(*li->counters));
|
||||
if (li->counters)
|
||||
memset(li->counters, 0, sizeof(*li->counters));
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue