summaryrefslogtreecommitdiff
path: root/src/defrag.c
diff options
context:
space:
mode:
authorHuang Zw <huang_zhw@126.com>2021-01-28 00:56:43 +0800
committerGitHub <noreply@github.com>2021-01-27 18:56:43 +0200
commitf395119eded8294e80918331ebc4948eb5e5e006 (patch)
tree104b3d1a6b0fd86a0a1bd7c47f094bc7af433066 /src/defrag.c
parentad7d4c6b709ce94ed9a2fa3a1fcf9b8cf7843eff (diff)
downloadredis-f395119eded8294e80918331ebc4948eb5e5e006.tar.gz
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.
Diffstat (limited to 'src/defrag.c')
-rw-r--r--src/defrag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/defrag.c b/src/defrag.c
index e189deddd..db797711e 100644
--- a/src/defrag.c
+++ b/src/defrag.c
@@ -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);
}