aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/message.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/message.cc')
-rw-r--r--src/google/protobuf/message.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc
index 09166f3a..91e6878e 100644
--- a/src/google/protobuf/message.cc
+++ b/src/google/protobuf/message.cc
@@ -168,8 +168,11 @@ bool Message::SerializePartialToFileDescriptor(int file_descriptor) const {
}
bool Message::SerializeToOstream(ostream* output) const {
- io::OstreamOutputStream zero_copy_output(output);
- return SerializeToZeroCopyStream(&zero_copy_output);
+ {
+ io::OstreamOutputStream zero_copy_output(output);
+ if (!SerializeToZeroCopyStream(&zero_copy_output)) return false;
+ }
+ return output->good();
}
bool Message::SerializePartialToOstream(ostream* output) const {