Minor refactor
Protect against a NULL pointer dereference, and remove unused write to a variable.
This commit is contained in:
parent
d756f68a59
commit
560e664862
@ -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));
|
||||
|
||||
2
test.c
2
test.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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user