parent
585cdf3a8f
commit
e1a94c0dde
@ -4380,6 +4380,11 @@ void clusterCommand(client *c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Avoid allocating more than needed in case of large COUNT argument
|
||||||
|
* and smaller actual number of keys. */
|
||||||
|
unsigned int keys_in_slot = countKeysInSlot(slot);
|
||||||
|
if (maxkeys > keys_in_slot) maxkeys = keys_in_slot;
|
||||||
|
|
||||||
keys = zmalloc(sizeof(robj*)*maxkeys);
|
keys = zmalloc(sizeof(robj*)*maxkeys);
|
||||||
numkeys = getKeysInSlot(slot, keys, maxkeys);
|
numkeys = getKeysInSlot(slot, keys, maxkeys);
|
||||||
addReplyMultiBulkLen(c,numkeys);
|
addReplyMultiBulkLen(c,numkeys);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user