diff options
author | Matt Stancliff <matt@genges.com> | 2015-01-05 10:22:22 -0500 |
---|---|---|
committer | Matt Stancliff <matt@genges.com> | 2015-01-05 16:39:30 -0500 |
commit | 9b83ddc2d99ffc2b650e7efc9e0ed82ecb37fdf3 (patch) | |
tree | 853332433fbce2ebec2c12cd2d684e6a4b823758 | |
parent | 7c4d2557c4bbc637514392cb725719790b50f677 (diff) | |
download | hiredict-9b83ddc2d99ffc2b650e7efc9e0ed82ecb37fdf3.tar.xz |
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.
-rw-r--r-- | async.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |