mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
ZREMRANGEBYLEX memory leak removed calling zslFreeLexRange().
This commit is contained in:
parent
85a2f2354e
commit
ab3afe2f4d
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user