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
220375b4
Commit
220375b4
authored
Feb 28, 2018
by
artix
Browse files
Fixed memory write error in clusterManagerGetConfigSignature
parent
99da9c95
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
220375b4
...
...
@@ -2295,7 +2295,7 @@ static void clusterManagerShowNodes(void) {
while ((ln = listNext(&li)) != NULL) {
clusterManagerNode *node = ln->value;
sds info = clusterManagerNodeInfo(node, 0);
printf("%s\n", info);
printf("%s\n",
(char *)
info);
sdsfree(info);
}
}
...
...
@@ -2916,8 +2916,8 @@ static sds clusterManagerGetConfigSignature(clusterManagerNode *node) {
line = p + 1;
if (i == 0) {
nodename = token;
tot_size = p - token;
name_len = tot_size
;
tot_size =
(
p - token
)
;
name_len = tot_size
++; // Make room for ':' in tot_size
} else if (i == 8) break;
i++;
}
...
...
@@ -2951,6 +2951,7 @@ static sds clusterManagerGetConfigSignature(clusterManagerNode *node) {
node_count++;
node_configs =
zrealloc(node_configs, (node_count * sizeof(char *)));
/* Make room for '|' separators. */
tot_size += (sizeof(char) * (c - 1));
char *cfg = zmalloc((sizeof(char) * tot_size) + 1);
memcpy(cfg, nodename, name_len);
...
...
@@ -3760,7 +3761,7 @@ static int clusterManagerCommandReshard(int argc, char **argv) {
opts, &err);
if (!result) {
if (err != NULL) {
clusterManagerLogErr("\n%s\n", err);
//
clusterManagerLogErr("\n%s\n", err);
zfree(err);
}
goto cleanup;
...
...
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