From 591f29e0f5493f1e375c06ae225dc5aafe5b37fb Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 17 Jun 2011 15:40:55 +0200 Subject: [PATCH] Use a safe iterator while saving the DB, since the getExpire() function will access the iterating dictionary. --- src/aof.c | 2 +- src/rdb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aof.c b/src/aof.c index 030972699..dbd0468d8 100644 --- a/src/aof.c +++ b/src/aof.c @@ -342,7 +342,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; diff --git a/src/rdb.c b/src/rdb.c index a2471aef6..f98d85798 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -430,7 +430,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;