summaryrefslogtreecommitdiff
path: root/async.c
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-04-07 11:32:16 -0400
committerMatt Stancliff <matt@genges.com>2014-04-08 19:37:45 -0400
commit61eeedbe77a7fef16e44b6fe215a689b7911044e (patch)
tree65bbb2380f7cd141bdbfe1b401b03a40a286d5aa /async.c
parente35266e68fa2f9a292639eb7e499eace226101d0 (diff)
downloadhiredict-61eeedbe77a7fef16e44b6fe215a689b7911044e.tar.xz
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
Diffstat (limited to 'async.c')
-rw-r--r--async.c2
1 files changed, 1 insertions, 1 deletions
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;