From e9c1bf02da2f6d78fee76defd0a303ea19b67767 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 23 Dec 2016 08:44:26 -0500 Subject: Fix file descriptor leak introduced in bcae34c0c Caused tests to fail on CI --- src/lib/utils/data_src.cpp | 5 +---- src/lib/utils/data_src.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'src/lib/utils') diff --git a/src/lib/utils/data_src.cpp b/src/lib/utils/data_src.cpp index 55202daac..d589d5ceb 100644 --- a/src/lib/utils/data_src.cpp +++ b/src/lib/utils/data_src.cpp @@ -182,14 +182,11 @@ std::string DataSource_Stream::id() const DataSource_Stream::DataSource_Stream(const std::string& path, bool use_binary) : m_identifier(path), - m_source_p(new std::ifstream(path, - use_binary ? std::ios::binary : std::ios::in)), - m_source(*m_source_p), + m_source_memory(new std::ifstream(path, use_binary ? std::ios::binary : std::ios::in)), m_total_read(0) { if(!m_source.good()) { - delete m_source_p; throw Stream_IO_Error("DataSource: Failure opening file " + path); } } diff --git a/src/lib/utils/data_src.h b/src/lib/utils/data_src.h index 29f557606..5e062d3d7 100644 --- a/src/lib/utils/data_src.h +++ b/src/lib/utils/data_src.h @@ -172,7 +172,6 @@ class BOTAN_DLL DataSource_Stream : public DataSource const std::string m_identifier; std::unique_ptr m_source_memory; - std::istream* m_source_p; std::istream& m_source; size_t m_total_read; }; -- cgit v1.2.3