Commit 1102a8a7 authored by Feng Xiao's avatar Feng Xiao Committed by GitHub

Merge pull request #1923 from bryongloden/patch-1

close opened file descriptors properly
parents e30b7b44 a375e1ac
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment