diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-08-05 15:28:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-05 15:28:42 -0700 |
commit | 1102a8a7675d6b718e81b28a10173a2e073c3820 (patch) | |
tree | f5f310bc1c85b5ba160ee0f507c6ea69e5ef6108 | |
parent | e30b7b446175c75cc85beca9015685c6f7705af4 (diff) | |
parent | a375e1acfd41432cc5a6be3de20067cce7dee5fd (diff) | |
download | protobuf-1102a8a7675d6b718e81b28a10173a2e073c3820.tar.gz protobuf-1102a8a7675d6b718e81b28a10173a2e073c3820.tar.bz2 protobuf-1102a8a7675d6b718e81b28a10173a2e073c3820.zip |
Merge pull request #1923 from bryongloden/patch-1
close opened file descriptors properly
-rw-r--r-- | src/google/protobuf/testing/file.cc | 1 |
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; } |