AOF file descriptor leak fixed
This commit is contained in:
parent
15db4aa006
commit
4aec2ec8c4
@ -220,8 +220,10 @@ int loadAppendOnlyFile(char *filename) {
|
|||||||
int appendonly = server.appendonly;
|
int appendonly = server.appendonly;
|
||||||
long loops = 0;
|
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;
|
return REDIS_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
redisLog(REDIS_WARNING,"Fatal error: can't open the append log file for reading: %s",strerror(errno));
|
redisLog(REDIS_WARNING,"Fatal error: can't open the append log file for reading: %s",strerror(errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user