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
3ff56a6d
Unverified
Commit
3ff56a6d
authored
Sep 24, 2021
by
Ozan Tezcan
Committed by
GitHub
Sep 24, 2021
Browse files
Fix crash due to free() call for a string literal in redis-benchmark (#9546)
parent
9967a53f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
3ff56a6d
...
...
@@ -1421,6 +1421,7 @@ int parseOptions(int argc, char **argv) {
config
.
keepalive
=
atoi
(
argv
[
++
i
]);
}
else
if
(
!
strcmp
(
argv
[
i
],
"-h"
))
{
if
(
lastarg
)
goto
invalid
;
sdsfree
(
config
.
conn_info
.
hostip
);
config
.
conn_info
.
hostip
=
sdsnew
(
argv
[
++
i
]);
}
else
if
(
!
strcmp
(
argv
[
i
],
"-p"
))
{
if
(
lastarg
)
goto
invalid
;
...
...
@@ -1720,7 +1721,7 @@ int main(int argc, char **argv) {
config
.
loop
=
0
;
config
.
idlemode
=
0
;
config
.
clients
=
listCreate
();
config
.
conn_info
.
hostip
=
"127.0.0.1"
;
config
.
conn_info
.
hostip
=
sdsnew
(
"127.0.0.1"
)
;
config
.
conn_info
.
hostport
=
6379
;
config
.
hostsocket
=
NULL
;
config
.
tests
=
NULL
;
...
...
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