ZREMRANGEBYLEX memory leak removed calling zslFreeLexRange().

This commit is contained in:
antirez 2014-04-18 13:01:04 +02:00
parent 85a2f2354e
commit ab3afe2f4d

View File

@ -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) {