Commit 560e6648 authored by michael-grunder's avatar michael-grunder Committed by Michael Grunder
Browse files

Minor refactor

Protect against a NULL pointer dereference, and remove unused write
to a variable.
parent d756f68a
...@@ -747,7 +747,7 @@ void redisFree(redisContext *c) { ...@@ -747,7 +747,7 @@ void redisFree(redisContext *c) {
if (c->privdata && c->free_privdata) if (c->privdata && c->free_privdata)
c->free_privdata(c->privdata); c->free_privdata(c->privdata);
if (c->funcs->free_privctx) if (c->funcs && c->funcs->free_privctx)
c->funcs->free_privctx(c->privctx); c->funcs->free_privctx(c->privctx);
memset(c, 0xff, sizeof(*c)); memset(c, 0xff, sizeof(*c));
......
...@@ -1999,7 +1999,7 @@ static void connectCallback(redisAsyncContext *c, int status) { ...@@ -1999,7 +1999,7 @@ static void connectCallback(redisAsyncContext *c, int status) {
} }
else if (t->testno == ASTEST_ISSUE_931_PING) 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) { static void disconnectCallback(const redisAsyncContext *c, int status) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment