Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5b5dd730
Commit
5b5dd730
authored
Apr 18, 2014
by
antirez
Browse files
ZREMRANGEBYLEX memory leak removed calling zslFreeLexRange().
parent
ca6c7938
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
5b5dd730
...
...
@@ -1406,7 +1406,7 @@ void zremrangeGenericCommand(redisClient *c, int rangetype) {
/* Step 2: Lookup & range sanity checks if needed. */
if
((
zobj
=
lookupKeyWriteOrReply
(
c
,
key
,
shared
.
czero
))
==
NULL
||
checkType
(
c
,
zobj
,
REDIS_ZSET
))
return
;
checkType
(
c
,
zobj
,
REDIS_ZSET
))
goto
cleanup
;
if
(
rangetype
==
ZRANGE_RANK
)
{
/* Sanitize indexes. */
...
...
@@ -1419,7 +1419,7 @@ void zremrangeGenericCommand(redisClient *c, int rangetype) {
* The range is empty when start > end or start >= length. */
if
(
start
>
end
||
start
>=
llen
)
{
addReply
(
c
,
shared
.
czero
);
return
;
goto
cleanup
;
}
if
(
end
>=
llen
)
end
=
llen
-
1
;
}
...
...
@@ -1473,6 +1473,9 @@ void zremrangeGenericCommand(redisClient *c, int rangetype) {
}
server
.
dirty
+=
deleted
;
addReplyLongLong
(
c
,
deleted
);
cleanup:
if
(
rangetype
==
ZRANGE_LEX
)
zslFreeLexRange
(
&
lexrange
);
}
void
zremrangebyrankCommand
(
redisClient
*
c
)
{
...
...
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