Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
23214966
Commit
23214966
authored
Jan 19, 2019
by
Zhicheng Wei
Committed by
antirez
Jan 25, 2019
Browse files
fix clusterManagerGetAntiAffinityScore double free otypes
parent
80bccd71
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
23214966
...
@@ -2436,9 +2436,10 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
...
@@ -2436,9 +2436,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. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment