Permalink
Browse files

Use a safe iterator while saving the DB, since the getExpire() functi…

…on will access the iterating dictionary.
  • Loading branch information...
1 parent 4ec8b73 commit 25e805b417303531f78e1320426f6f9f2ad4d300 @antirez committed Jun 17, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/aof.c
  2. +1 −1 src/rdb.c
View
2 src/aof.c
@@ -348,7 +348,7 @@ int rewriteAppendOnlyFile(char *filename) {
redisDb *db = server.db+j;
dict *d = db->dict;
if (dictSize(d) == 0) continue;
- di = dictGetIterator(d);
+ di = dictGetSafeIterator(d);
if (!di) {
fclose(fp);
return REDIS_ERR;
View
2 src/rdb.c
@@ -427,7 +427,7 @@ int rdbSave(char *filename) {
redisDb *db = server.db+j;
dict *d = db->dict;
if (dictSize(d) == 0) continue;
- di = dictGetIterator(d);
+ di = dictGetSafeIterator(d);
if (!di) {
fclose(fp);
return REDIS_ERR;

0 comments on commit 25e805b

Please sign in to comment.