Merge pull request #1923 from bryongloden/patch-1

close opened file descriptors properly
This commit is contained in:
Feng Xiao 2016-08-05 15:28:42 -07:00 committed by GitHub
commit 1102a8a767

View File

@ -91,6 +91,7 @@ bool File::WriteStringToFile(const string& contents, const string& name) {
if (fwrite(contents.data(), 1, contents.size(), file) != contents.size()) {
GOOGLE_LOG(ERROR) << "fwrite(" << name << "): " << strerror(errno);
fclose(file);
return false;
}