Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

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 f2ac948 commit b04e800
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 @@ -354,7 +354,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 @@ -416,7 +416,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 b04e800

Please sign in to comment.