fix potential uninitialized read

If callback was set before scheduleTimer was set (i..e before one of the
attach()) calls.
This commit is contained in:
Mark Nunberg 2019-02-11 11:26:15 -05:00
parent 0bc2356ed5
commit 5f633ac4ec
1 changed files with 2 additions and 1 deletions

View File

@ -144,6 +144,7 @@ static redisAsyncContext *redisAsyncInitialize(redisContext *c) {
ac->ev.addWrite = NULL;
ac->ev.delWrite = NULL;
ac->ev.cleanup = NULL;
ac->ev.scheduleTimer = NULL;
ac->onConnect = NULL;
ac->onDisconnect = NULL;
@ -844,4 +845,4 @@ void redisAsyncSetTimeout(redisAsyncContext *ac, struct timeval tv) {
}
*ac->c.timeout = tv;
}
}