close opened file descriptors properly

This commit is contained in:
Bryon Gloden, CISSP® 2016-08-04 15:26:27 -04:00 committed by Bryon Gloden
parent c59473d53e
commit a375e1acfd

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;
}