Sentinel: fix access to NULL link->cc in releaseInstanceLink()

This commit is contained in:
antirez 2015-05-14 14:08:19 +02:00
parent 87b6013adb
commit b44c37482c

View File

@ -968,7 +968,7 @@ instanceLink *releaseInstanceLink(instanceLink *link, sentinelRedisInstance *ri)
redisAssert(link->refcount > 0); redisAssert(link->refcount > 0);
link->refcount--; link->refcount--;
if (link->refcount != 0) { if (link->refcount != 0) {
if (ri) { if (ri && ri->link->cc) {
/* This instance may have pending callbacks in the hiredis async /* This instance may have pending callbacks in the hiredis async
* context, having as 'privdata' the instance that we are going to * context, having as 'privdata' the instance that we are going to
* free. Let's rewrite the callback list, directly exploiting * free. Let's rewrite the callback list, directly exploiting