From 5f633ac4ec0ee818fb9785e751fbbdfab48f9542 Mon Sep 17 00:00:00 2001 From: Mark Nunberg Date: Mon, 11 Feb 2019 11:26:15 -0500 Subject: [PATCH] fix potential uninitialized read If callback was set before scheduleTimer was set (i..e before one of the attach()) calls. --- async.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/async.c b/async.c index a32d528..0ed973e 100644 --- a/async.c +++ b/async.c @@ -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; -} \ No newline at end of file +}