mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Merge pull request #4431 from itamarhaber/patch-10
Fixes an off-by-one in argument handling of `MEMORY USAGE`
This commit is contained in:
commit
30db805548
@ -1074,7 +1074,7 @@ void memoryCommand(client *c) {
|
|||||||
if ((o = objectCommandLookupOrReply(c,c->argv[2],shared.nullbulk))
|
if ((o = objectCommandLookupOrReply(c,c->argv[2],shared.nullbulk))
|
||||||
== NULL) return;
|
== NULL) return;
|
||||||
size_t usage = objectComputeSize(o,samples);
|
size_t usage = objectComputeSize(o,samples);
|
||||||
usage += sdsAllocSize(c->argv[1]->ptr);
|
usage += sdsAllocSize(c->argv[2]->ptr);
|
||||||
usage += sizeof(dictEntry);
|
usage += sizeof(dictEntry);
|
||||||
addReplyLongLong(c,usage);
|
addReplyLongLong(c,usage);
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"stats") && c->argc == 2) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"stats") && c->argc == 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user