diff options
author | antirez <antirez@gmail.com> | 2011-06-17 15:40:55 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-06-17 15:41:10 +0200 |
commit | 25e805b417303531f78e1320426f6f9f2ad4d300 (patch) | |
tree | 45f97ebd470c19f10494a22df40b22cbfdfa7b56 | |
parent | 4ec8b732b7b89bffa5586074a69737079bb0ea7f (diff) | |
download | redis-25e805b417303531f78e1320426f6f9f2ad4d300.tar.gz |
Use a safe iterator while saving the DB, since the getExpire() function will access the iterating dictionary.
-rw-r--r-- | src/aof.c | 2 | ||||
-rw-r--r-- | src/rdb.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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; @@ -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; |