util: Check for file being NULL in DirectoryCommit

pull/826/head
Luke Dashjr 6 years ago
parent 4574904038
commit ef712298c3

@ -1047,8 +1047,10 @@ void DirectoryCommit(const fs::path &dirname)
{ {
#ifndef WIN32 #ifndef WIN32
FILE* file = fsbridge::fopen(dirname, "r"); FILE* file = fsbridge::fopen(dirname, "r");
fsync(fileno(file)); if (file) {
fclose(file); fsync(fileno(file));
fclose(file);
}
#endif #endif
} }

Loading…
Cancel
Save