diff --git a/src/aof.c b/src/aof.c index 5fe8c773..16dbeab6 100644 --- a/src/aof.c +++ b/src/aof.c @@ -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; diff --git a/src/rdb.c b/src/rdb.c index b12db443..0c572807 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -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;