summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-12-10 11:05:37 +0100
committerantirez <antirez@gmail.com>2014-12-10 11:05:37 +0100
commit0422321617861a4a5b7b88d8767f6c3aa33189fa (patch)
tree66957517539328513f56ab8caee328665a85d03d
parent7576a27d586eb2ba63848c91eaefcccaf505160e (diff)
downloadredis-0422321617861a4a5b7b88d8767f6c3aa33189fa.tar.gz
Sentinel: removed useless flag var from INFO-CACHE.
-rw-r--r--src/sentinel.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 40b32dd1e..1308cd875 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -2797,12 +2797,10 @@ void sentinelCommand(redisClient *c) {
dictType copy_keeper = instancesDictType;
copy_keeper.valDestructor = NULL;
dict *masters_local = NULL;
- int needs_cleanup = 0;
if (c->argc == 2) {
masters_local = sentinel.masters;
} else {
masters_local = dictCreate(&copy_keeper, NULL);
- needs_cleanup = 1;
for (int i = 2; i < c->argc; i++) {
sentinelRedisInstance *ri;
@@ -2841,7 +2839,7 @@ void sentinelCommand(redisClient *c) {
dictReleaseIterator(sdi);
}
dictReleaseIterator(di);
- if (needs_cleanup) dictRelease(masters_local);
+ if (masters_local != sentinel.masters) dictRelease(masters_local);
} else {
addReplyErrorFormat(c,"Unknown sentinel subcommand '%s'",
(char*)c->argv[1]->ptr);