From 2cdf498bbdf99c97a77b528507eb2b9083c52038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Mon, 4 Jul 2016 14:04:00 +0100 Subject: [PATCH] sstables: close input stream in sstable::data_read() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Dziepak --- sstables/sstables.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sstables/sstables.cc b/sstables/sstables.cc index 0190c7ed92..902233e820 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -1839,7 +1839,9 @@ input_stream sstable::data_stream(uint64_t pos, size_t len, const io_prior future> sstable::data_read(uint64_t pos, size_t len, const io_priority_class& pc) { return do_with(data_stream(pos, len, pc), [len] (auto& stream) { - return stream.read_exactly(len); + return stream.read_exactly(len).finally([&stream] { + return stream.close(); + }); }); }