Sentinel: fix sentinelTryConnectionSharing() by checking for no match

Trivial omission of the obvious no-match case.
This commit is contained in:
antirez 2015-05-20 09:59:55 +02:00
parent 164b6bbab5
commit c54de703f2

View File

@ -1023,6 +1023,7 @@ int sentinelTryConnectionSharing(sentinelRedisInstance *ri) {
if (master == ri->master) continue;
match = getSentinelRedisInstanceByAddrAndRunID(master->sentinels,
NULL,0,ri->runid);
if (match == NULL) continue; /* No match. */
if (match == ri) continue; /* Should never happen but... safer. */
/* We identified a matching Sentinel, great! Let's free our link