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