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
8caecc9a
Commit
8caecc9a
authored
Mar 10, 2014
by
antirez
Browse files
Fixed memory leak in SORT LIMIT option argument parsing on error.
parent
ef5e7fba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sort.c
View file @
8caecc9a
...
...
@@ -231,8 +231,15 @@ void sortCommand(redisClient *c) {
}
else
if
(
!
strcasecmp
(
c
->
argv
[
j
]
->
ptr
,
"alpha"
))
{
alpha
=
1
;
}
else
if
(
!
strcasecmp
(
c
->
argv
[
j
]
->
ptr
,
"limit"
)
&&
leftargs
>=
2
)
{
if
((
getLongFromObjectOrReply
(
c
,
c
->
argv
[
j
+
1
],
&
limit_start
,
NULL
)
!=
REDIS_OK
)
||
(
getLongFromObjectOrReply
(
c
,
c
->
argv
[
j
+
2
],
&
limit_count
,
NULL
)
!=
REDIS_OK
))
return
;
if
((
getLongFromObjectOrReply
(
c
,
c
->
argv
[
j
+
1
],
&
limit_start
,
NULL
)
!=
REDIS_OK
)
||
(
getLongFromObjectOrReply
(
c
,
c
->
argv
[
j
+
2
],
&
limit_count
,
NULL
)
!=
REDIS_OK
))
{
decrRefCount
(
sortval
);
listRelease
(
operations
);
return
;
}
j
+=
2
;
}
else
if
(
!
strcasecmp
(
c
->
argv
[
j
]
->
ptr
,
"store"
)
&&
leftargs
>=
1
)
{
storekey
=
c
->
argv
[
j
+
1
];
...
...
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