diff --git a/src/db.c b/src/db.c index 9bf135613..be3839bb6 100644 --- a/src/db.c +++ b/src/db.c @@ -408,11 +408,7 @@ void scanCommand(redisClient *c) { } cleanup: - while ((node = listFirst(keys)) != NULL) { - robj *kobj = listNodeValue(node); - decrRefCount(kobj); - listDelNode(keys, node); - } + listSetFreeMethod(keys,decrRefCountVoid); listRelease(keys); }