From 61eeedbe77a7fef16e44b6fe215a689b7911044e Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Mon, 7 Apr 2014 11:32:16 -0400 Subject: [PATCH] Fix potential undefined struct read All the assignments to cb are inside conditionals, so it's vaguely possible it never gets initialized before we try to read from it with (cb.fn == NULL). Condition discovered with scan-build. Closes #229 --- async.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/async.c b/async.c index 48c40c3..f3b57e3 100644 --- a/async.c +++ b/async.c @@ -391,7 +391,7 @@ static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply, void redisProcessCallbacks(redisAsyncContext *ac) { redisContext *c = &(ac->c); - redisCallback cb; + redisCallback cb = {NULL, NULL, NULL}; void *reply = NULL; int status;