Commit d04b5211 authored by Guy Benoish's avatar Guy Benoish Committed by antirez
Browse files

Fix zlexrangespec mem-leak in genericZrangebylexCommand

parent 516f1c77
...@@ -2907,7 +2907,10 @@ void genericZrangebylexCommand(client *c, int reverse) { ...@@ -2907,7 +2907,10 @@ void genericZrangebylexCommand(client *c, int reverse) {
while (remaining) { while (remaining) {
if (remaining >= 3 && !strcasecmp(c->argv[pos]->ptr,"limit")) { if (remaining >= 3 && !strcasecmp(c->argv[pos]->ptr,"limit")) {
if ((getLongFromObjectOrReply(c, c->argv[pos+1], &offset, NULL) != C_OK) || if ((getLongFromObjectOrReply(c, c->argv[pos+1], &offset, NULL) != C_OK) ||
(getLongFromObjectOrReply(c, c->argv[pos+2], &limit, NULL) != C_OK)) return; (getLongFromObjectOrReply(c, c->argv[pos+2], &limit, NULL) != C_OK)) {
zslFreeLexRange(&range);
return;
}
pos += 3; remaining -= 3; pos += 3; remaining -= 3;
} else { } else {
zslFreeLexRange(&range); zslFreeLexRange(&range);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment