From 4433f5a7f24350cb398ae448fca691a53a51a155 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 21 Jan 2015 16:39:38 +0100 Subject: [PATCH] AOF rewrite: set iterator var to NULL when freed. The cleanup code expects that if 'di' is not NULL, it is a valid iterator that should be freed. The result of this bug was a crash of the AOF rewriting process if an error occurred after the DBs data are written and the iterator is no longer valid. --- src/aof.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aof.c b/src/aof.c index f5a90a12..dc7d1187 100644 --- a/src/aof.c +++ b/src/aof.c @@ -1082,6 +1082,7 @@ int rewriteAppendOnlyFile(char *filename) { } } dictReleaseIterator(di); + di = NULL; } /* Do an initial slow fsync here while the parent is still sending