Commit 23214966 authored by Zhicheng Wei's avatar Zhicheng Wei Committed by antirez
Browse files

fix clusterManagerGetAntiAffinityScore double free otypes

parent 80bccd71
......@@ -2436,9 +2436,10 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
}
// Master type 'm' is always set as the first character of the
// types string.
otypes = sdsdup(otypes);
if (!node->replicate) types = sdscatprintf(otypes, "m%s", otypes);
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
* same host, what is their local score. */
......
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