diff options
author | michael-grunder <michael.grunder@gmail.com> | 2022-09-08 11:08:18 -0700 |
---|---|---|
committer | Michael Grunder <michael.grunder@gmail.com> | 2022-09-08 11:18:43 -0700 |
commit | 560e6648627cfd9bf347cffe5616d8043cbe940e (patch) | |
tree | c0a514c0fe767cbb8765fa63e86ede63056ca7d4 | |
parent | d756f68a59d694a91c1882c782161a023ea67766 (diff) |
Minor refactor
Protect against a NULL pointer dereference, and remove unused write
to a variable.
-rw-r--r-- | hiredis.c | 2 | ||||
-rw-r--r-- | test.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -747,7 +747,7 @@ void redisFree(redisContext *c) { if (c->privdata && c->free_privdata) c->free_privdata(c->privdata); - if (c->funcs->free_privctx) + if (c->funcs && c->funcs->free_privctx) c->funcs->free_privctx(c->privctx); memset(c, 0xff, sizeof(*c)); @@ -1999,7 +1999,7 @@ static void connectCallback(redisAsyncContext *c, int status) { } else if (t->testno == ASTEST_ISSUE_931_PING) { - status = redisAsyncCommand(c, commandCallback, NULL, "PING"); + redisAsyncCommand(c, commandCallback, NULL, "PING"); } } static void disconnectCallback(const redisAsyncContext *c, int status) { |