aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/testing/file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/testing/file.cc')
-rw-r--r--src/google/protobuf/testing/file.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc
index 3d07b127..bc76c844 100644
--- a/src/google/protobuf/testing/file.cc
+++ b/src/google/protobuf/testing/file.cc
@@ -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;
}