Merge pull request #5529 from yongman/fix-rediscli-malloc

fix zmalloc in clusterManagerComputeReshardTable
This commit is contained in:
Salvatore Sanfilippo 2018-11-06 12:05:24 +01:00 committed by GitHub
commit d9e822a14b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4157,7 +4157,7 @@ static clusterManagerNode *clusterNodeForResharding(char *id,
static list *clusterManagerComputeReshardTable(list *sources, int numslots) {
list *moved = listCreate();
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;
listNode *ln;
listRewind(sources, &li);