mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
util: Check for file being NULL in DirectoryCommit
This commit is contained in:
@@ -1047,8 +1047,10 @@ void DirectoryCommit(const fs::path &dirname)
|
||||
{
|
||||
#ifndef WIN32
|
||||
FILE* file = fsbridge::fopen(dirname, "r");
|
||||
fsync(fileno(file));
|
||||
fclose(file);
|
||||
if (file) {
|
||||
fsync(fileno(file));
|
||||
fclose(file);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user