summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-01-21 16:39:38 +0100
committerantirez <antirez@gmail.com>2015-01-21 16:42:56 +0100
commite7aa5fb5ef5e106895261b9a7fc6e65874e22d7e (patch)
tree50109da3875b02e087dbfb6d25d8a6768f9b67de
parent8a41dae49fb6331a6999b958b76a3f29a4bbe7cd (diff)
downloadredis-e7aa5fb5ef5e106895261b9a7fc6e65874e22d7e.tar.gz
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.
-rw-r--r--src/aof.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/aof.c b/src/aof.c
index 90b67fd9c..63bde53cc 100644
--- a/src/aof.c
+++ b/src/aof.c
@@ -1038,6 +1038,7 @@ int rewriteAppendOnlyFile(char *filename) {
}
}
dictReleaseIterator(di);
+ di = NULL;
}
/* Make sure data will not remain on the OS's output buffers */