X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/69bfffb4a7aec38e5079ec10b0acc8629c1ee82b..22b9bf15949933b351525ae658dc32e40e5784ab:/src/aof.c diff --git a/src/aof.c b/src/aof.c index 56392f2a..8ce6cd12 100644 --- a/src/aof.c +++ b/src/aof.c @@ -220,8 +220,10 @@ int loadAppendOnlyFile(char *filename) { int appendonly = server.appendonly; long loops = 0; - if (redis_fstat(fileno(fp),&sb) != -1 && sb.st_size == 0) + if (fp && redis_fstat(fileno(fp),&sb) != -1 && sb.st_size == 0) { + fclose(fp); return REDIS_ERR; + } if (fp == NULL) { redisLog(REDIS_WARNING,"Fatal error: can't open the append log file for reading: %s",strerror(errno));