fix malloc in clusterManagerComputeReshardTable

This commit is contained in:
yongman 2018-11-06 10:51:19 +08:00 committed by antirez
parent 90b52fde57
commit 1c637de98c

View File

@ -4157,7 +4157,7 @@ static clusterManagerNode *clusterNodeForResharding(char *id,
static list *clusterManagerComputeReshardTable(list *sources, int numslots) { static list *clusterManagerComputeReshardTable(list *sources, int numslots) {
list *moved = listCreate(); list *moved = listCreate();
int src_count = listLength(sources), i = 0, tot_slots = 0, j; int src_count = listLength(sources), i = 0, tot_slots = 0, j;
clusterManagerNode **sorted = zmalloc(src_count * sizeof(**sorted)); clusterManagerNode **sorted = zmalloc(src_count * sizeof(*sorted));
listIter li; listIter li;
listNode *ln; listNode *ln;
listRewind(sources, &li); listRewind(sources, &li);