OOM is possible. In /src/rax.c:1589, you need to make a check, similar to line 1583.

If there is a out of memory here, then: The key length in the iterator will increase But the turnkey memory will not be allocated. The iterator will go into an inconsistent state. Further operations with it will lead to a crash.

Comment From: sundb

@Ququrruzza thx, but OOM is handled by zmalloc_default_oom in Redis.