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:
Matt Stancliff 2015-01-05 10:22:22 -05:00
parent 7c4d2557c4
commit 9b83ddc2d9
1 changed files with 3 additions and 0 deletions

View File

@ -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;