Commit 3c9b8172 authored by Jan-Erik Rediger's avatar Jan-Erik Rediger
Browse files

Don't divide by zero

Previously Redis crashed on `MEMORY DOCTOR` when it has no slaves attached.

Fixes #3783
parent 2e4f53a7
......@@ -951,7 +951,7 @@ sds getMemoryDoctorReport(void) {
}
/* Slaves using more than 10 MB each? */
if (mh->clients_slaves / numslaves > (1024*1024*10)) {
if (numslaves > 0 && mh->clients_slaves / numslaves > (1024*1024*10)) {
big_slave_buf = 1;
num_reports++;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment