Commit 9b83ddc2 authored by Matt Stancliff's avatar Matt Stancliff
Browse files

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.
parent 7c4d2557
...@@ -142,6 +142,9 @@ static redisAsyncContext *redisAsyncInitialize(redisContext *c) { ...@@ -142,6 +142,9 @@ static redisAsyncContext *redisAsyncInitialize(redisContext *c) {
/* We want the error field to be accessible directly instead of requiring /* We want the error field to be accessible directly instead of requiring
* an indirection to the redisContext struct. */ * an indirection to the redisContext struct. */
static void __redisAsyncCopyError(redisAsyncContext *ac) { static void __redisAsyncCopyError(redisAsyncContext *ac) {
if (!ac)
return;
redisContext *c = &(ac->c); redisContext *c = &(ac->c);
ac->err = c->err; ac->err = c->err;
ac->errstr = c->errstr; ac->errstr = c->errstr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment