Fix bug in activeDefragSdsListAndDict dead code (#8403)

In activeDefragSdsListAndDict when dict_val_type is DEFRAG_SDS_DICT_VAL_VOID_PTR, it should update de->v.val not ln->value.
Because this code path will never be executed, so this bug never happened.
This commit is contained in:
Huang Zw 2021-01-28 00:56:43 +08:00 committed by GitHub
parent a32f87de07
commit 379ea8a545

View File

@ -367,7 +367,7 @@ long activeDefragSdsListAndDict(list *l, dict *d, int dict_val_type) {
} else if (dict_val_type == DEFRAG_SDS_DICT_VAL_VOID_PTR) {
void *newptr, *ptr = dictGetVal(de);
if ((newptr = activeDefragAlloc(ptr)))
ln->value = newptr, defragged++;
de->v.val = newptr, defragged++;
}
defragged += dictIterDefragEntry(di);
}