summaryrefslogtreecommitdiff
path: root/async.c
diff options
context:
space:
mode:
authorCharlie Somerville <charlie@charliesomerville.com>2014-01-15 11:38:45 +1100
committerCharlie Somerville <charlie@charliesomerville.com>2014-01-15 11:38:45 +1100
commit070da2162364100c4069a1842b2641ab95b46a1a (patch)
treebcac62c132c39cdf803530164c2c2c1dcbcaae9a /async.c
parent81c95a5fd3eadf51aaeb56524bb9e049cf70a129 (diff)
async.c: avoid a NULL deref when redisAsyncInitialize returns NULL
Diffstat (limited to 'async.c')
-rw-r--r--async.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/async.c b/async.c
index 6532712..923a329 100644
--- a/async.c
+++ b/async.c
@@ -174,6 +174,11 @@ redisAsyncContext *redisAsyncConnectUnix(const char *path) {
return NULL;
ac = redisAsyncInitialize(c);
+ if (ac == NULL) {
+ redisFree(c);
+ return NULL;
+ }
+
__redisAsyncCopyError(ac);
return ac;
}
@@ -398,7 +403,7 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
__redisAsyncDisconnect(ac);
return;
}
-
+
/* If monitor mode, repush callback */
if(c->flags & REDIS_MONITORING) {
__redisPushCallback(&ac->replies,&cb);