Skip to content

Commit e7aa5fb

Browse files
committed
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.
1 parent 8a41dae commit e7aa5fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/aof.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ int rewriteAppendOnlyFile(char *filename) {
10381038
}
10391039
}
10401040
dictReleaseIterator(di);
1041+
di = NULL;
10411042
}
10421043

10431044
/* Make sure data will not remain on the OS's output buffers */

0 commit comments

Comments
 (0)