提交 3c9b8172 编写于 作者: J Jan-Erik Rediger

Don't divide by zero

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

Fixes #3783
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册