From 9b83ddc2d99ffc2b650e7efc9e0ed82ecb37fdf3 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Mon, 5 Jan 2015 10:22:22 -0500 Subject: Fix clang analyzer warning redisAsyncInitialize() can return NULL, but then we pass the return value from redisAsyncInitialize() into something dereferencing the return value, which can cause crashies. --- async.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/async.c b/async.c index 8b50de2..5acd01c 100644 --- a/async.c +++ b/async.c @@ -142,6 +142,9 @@ static redisAsyncContext *redisAsyncInitialize(redisContext *c) { /* We want the error field to be accessible directly instead of requiring * an indirection to the redisContext struct. */ static void __redisAsyncCopyError(redisAsyncContext *ac) { + if (!ac) + return; + redisContext *c = &(ac->c); ac->err = c->err; ac->errstr = c->errstr; -- cgit v1.2.3