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
8acc07e6
Unverified
Commit
8acc07e6
authored
Nov 20, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Nov 20, 2018
Browse files
Merge pull request #5579 from yongman/fix-rediscli-pointer-access
Fix pointer access and memory leak in redis-cli.
parents
30a455f1
64324901
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
8acc07e6
...
...
@@ -2829,7 +2829,7 @@ static int clusterManagerMigrateKeysInSlot(clusterManagerNode *source,
if
(
err
!=
NULL
)
{
*
err
=
zmalloc
((
reply
->
len
+
1
)
*
sizeof
(
char
));
strcpy
(
*
err
,
reply
->
str
);
CLUSTER_MANAGER_PRINT_REPLY_ERROR
(
source
,
err
);
CLUSTER_MANAGER_PRINT_REPLY_ERROR
(
source
,
*
err
);
}
goto
next
;
}
...
...
@@ -2947,7 +2947,7 @@ static int clusterManagerMoveSlot(clusterManagerNode *source,
if
(
err
!=
NULL
)
{
*
err
=
zmalloc
((
r
->
len
+
1
)
*
sizeof
(
char
));
strcpy
(
*
err
,
r
->
str
);
CLUSTER_MANAGER_PRINT_REPLY_ERROR
(
n
,
err
);
CLUSTER_MANAGER_PRINT_REPLY_ERROR
(
n
,
*
err
);
}
}
freeReplyObject
(
r
);
...
...
@@ -5196,10 +5196,13 @@ static int clusterManagerCommandSetTimeout(int argc, char **argv) {
n
->
port
);
ok_count
++
;
continue
;
reply_err:
reply_err:
;
int
need_free
=
0
;
if
(
err
==
NULL
)
err
=
""
;
else
need_free
=
1
;
clusterManagerLogErr
(
"ERR setting node-timeot for %s:%d: %s
\n
"
,
n
->
ip
,
n
->
port
,
err
);
if
(
need_free
)
zfree
(
err
);
err_count
++
;
}
clusterManagerLogInfo
(
">>> New node timeout set. %d OK, %d ERR.
\n
"
,
...
...
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