fix access to uninitialized var in checkClientPauseTimeoutAndReturnIfPaused (#8765)

server.client_pause_end_time is uninitialized, or actually 0, at startup,
which means this method would think the timeout was reached
and go look for paused clients.

This causes no harm since unpauseClients will not find any paused clients.
This commit is contained in:
Oran Agra 2021-04-13 08:41:12 +03:00 committed by GitHub
parent 175a9e3199
commit 733daef127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3332,6 +3332,8 @@ int areClientsPaused(void) {
* if it has. Also returns true if clients are now paused and false
* otherwise. */
int checkClientPauseTimeoutAndReturnIfPaused(void) {
if (!areClientsPaused())
return 0;
if (server.client_pause_end_time < server.mstime) {
unpauseClients();
}