Commit c54de703 authored by antirez's avatar antirez
Browse files

Sentinel: fix sentinelTryConnectionSharing() by checking for no match

Trivial omission of the obvious no-match case.
parent 164b6bba
...@@ -1023,6 +1023,7 @@ int sentinelTryConnectionSharing(sentinelRedisInstance *ri) { ...@@ -1023,6 +1023,7 @@ int sentinelTryConnectionSharing(sentinelRedisInstance *ri) {
if (master == ri->master) continue; if (master == ri->master) continue;
match = getSentinelRedisInstanceByAddrAndRunID(master->sentinels, match = getSentinelRedisInstanceByAddrAndRunID(master->sentinels,
NULL,0,ri->runid); NULL,0,ri->runid);
if (match == NULL) continue; /* No match. */
if (match == ri) continue; /* Should never happen but... safer. */ if (match == ri) continue; /* Should never happen but... safer. */
/* We identified a matching Sentinel, great! Let's free our link /* We identified a matching Sentinel, great! Let's free our link
......
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