Crash in Memory Doctor when all clients are slaves

Former-commit-id: f6814aa82564ad1b095edefeda9541859cbbb804
This commit is contained in:
John Sully 2019-03-03 13:56:47 -05:00
parent 2509750fc7
commit 5b557d3989

View File

@ -1133,7 +1133,7 @@ sds getMemoryDoctorReport(void) {
/* Clients using more than 200k each average? */
long numslaves = listLength(server.slaves);
long numclients = listLength(server.clients)-numslaves;
if (mh->clients_normal / numclients > (1024*200)) {
if ((numclients > 0) && mh->clients_normal / numclients > (1024*200)) {
big_client_buf = 1;
num_reports++;
}