mirror of
https://github.com/fluencelabs/redis
synced 2025-03-21 10:00:51 +00:00
Merge pull request #5795 from zhicheng/fix-double-free-issue
fix clusterManagerGetAntiAffinityScore double free otypes
This commit is contained in:
commit
ed356c3a79
@ -2471,9 +2471,10 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
|
|||||||
}
|
}
|
||||||
// Master type 'm' is always set as the first character of the
|
// Master type 'm' is always set as the first character of the
|
||||||
// types string.
|
// types string.
|
||||||
|
otypes = sdsdup(otypes);
|
||||||
if (!node->replicate) types = sdscatprintf(otypes, "m%s", otypes);
|
if (!node->replicate) types = sdscatprintf(otypes, "m%s", otypes);
|
||||||
else types = sdscat(otypes, "s");
|
else types = sdscat(otypes, "s");
|
||||||
if (types != otypes) dictReplace(related, key, types);
|
dictReplace(related, key, types);
|
||||||
}
|
}
|
||||||
/* Now it's trivial to check, for each related group having the
|
/* Now it's trivial to check, for each related group having the
|
||||||
* same host, what is their local score. */
|
* same host, what is their local score. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user