Skip to content

Commit

Permalink
Use a safe iterator while saving the DB, since the getExpire() functi…
Browse files Browse the repository at this point in the history
…on will access the iterating dictionary.
  • Loading branch information
antirez committed Jun 17, 2011
1 parent 4ec8b73 commit 25e805b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/aof.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/rdb.c
Expand Up @@ -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;
Expand Down

0 comments on commit 25e805b

Please sign in to comment.