From: antirez Date: Fri, 17 Jun 2011 13:40:55 +0000 (+0200) Subject: Use a safe iterator while saving the DB, since the getExpire() function will access... X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/591f29e0f5493f1e375c06ae225dc5aafe5b37fb Use a safe iterator while saving the DB, since the getExpire() function will access the iterating dictionary. --- diff --git a/src/aof.c b/src/aof.c index 03097269..dbd0468d 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 a2471aef..f98d8579 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;