X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/dddf5335f47d62d5e74308faff8dcb5d0575286c..da386cdf337a79b6734b58d3c5e426741e49c043:/src/aof.c diff --git a/src/aof.c b/src/aof.c index cd7c48d3..ef72a2b1 100644 --- a/src/aof.c +++ b/src/aof.c @@ -284,9 +284,11 @@ int loadAppendOnlyFile(char *filename) { /* The fake client should not have a reply */ redisAssert(fakeClient->bufpos == 0 && listLength(fakeClient->reply) == 0); - /* Clean up, ready for the next command */ - for (j = 0; j < argc; j++) decrRefCount(argv[j]); - zfree(argv); + /* Clean up. Command code may have changed argv/argc so we use the + * argv/argc of the client instead of the local variables. */ + for (j = 0; j < fakeClient->argc; j++) + decrRefCount(fakeClient->argv[j]); + zfree(fakeClient->argv); } /* This point can only be reached when EOF is reached without errors. @@ -346,7 +348,7 @@ int rewriteAppendOnlyFile(char *filename) { /* Iterate this DB writing every entry */ while((de = dictNext(di)) != NULL) { - sds keystr = dictGetEntryKey(de); + sds keystr; robj key, *o; time_t expiretime; @@ -460,7 +462,7 @@ int rewriteAppendOnlyFile(char *filename) { } zzlNext(zl,&eptr,&sptr); } - } else if (o->encoding == REDIS_ENCODING_RAW) { + } else if (o->encoding == REDIS_ENCODING_SKIPLIST) { zset *zs = o->ptr; dictIterator *di = dictGetIterator(zs->dict); dictEntry *de;