mirror of
https://github.com/fluencelabs/redis
synced 2025-06-20 20:46:31 +00:00
Don't divide by zero
Previously Redis crashed on `MEMORY DOCTOR` when it has no slaves attached. Fixes #3783
This commit is contained in:
committed by
antirez
parent
aee1ddca5d
commit
37b4c954a9
@ -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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user