mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Fixed memory leak in SORT LIMIT option argument parsing on error.
This commit is contained in:
parent
ef5e7fbaa2
commit
8caecc9ab4
11
src/sort.c
11
src/sort.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];
|
||||||
|
Loading…
Reference in New Issue
Block a user