From b97fd69aae5c145bf3d390a9a6d3783eb9584aa5 Mon Sep 17 00:00:00 2001 From: Mina Farid Date: Mon, 18 Jun 2018 11:53:30 -0400 Subject: Avoid closing unintialized substreams (#1411) * A substream should not be closed if pb_make_string_substream() failed to create it and returned false. * Fixed a potential wrong error message. --- Firestore/core/src/firebase/firestore/nanopb/reader.h | 1 - 1 file changed, 1 deletion(-) (limited to 'Firestore/core/src/firebase/firestore/nanopb/reader.h') diff --git a/Firestore/core/src/firebase/firestore/nanopb/reader.h b/Firestore/core/src/firebase/firestore/nanopb/reader.h index 2c16ec4..7dd7432 100644 --- a/Firestore/core/src/firebase/firestore/nanopb/reader.h +++ b/Firestore/core/src/firebase/firestore/nanopb/reader.h @@ -150,7 +150,6 @@ T Reader::ReadNestedMessage(const std::function& read_message_fn) { if (!pb_make_string_substream(&stream_, &raw_substream)) { status_ = util::Status(FirestoreErrorCode::DataLoss, PB_GET_ERROR(&stream_)); - pb_close_string_substream(&stream_, &raw_substream); return read_message_fn(this); } Reader substream(raw_substream); -- cgit v1.2.3