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.
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;