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.
This commit is contained in:
parent
7c4d2557c4
commit
9b83ddc2d9
3
async.c
3
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;
|
||||
|
|
Loading…
Reference in New Issue