aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-12-23 08:44:26 -0500
committerJack Lloyd <[email protected]>2016-12-23 08:44:26 -0500
commite9c1bf02da2f6d78fee76defd0a303ea19b67767 (patch)
tree3d6d6c588a1aed8a8a62aa4c597a895fa898c18f /src/lib
parent10555509dae09778b8d6e1831f837423490ca2c0 (diff)
Fix file descriptor leak introduced in bcae34c0c
Caused tests to fail on CI
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/utils/data_src.cpp5
-rw-r--r--src/lib/utils/data_src.h1
2 files changed, 1 insertions, 5 deletions
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<std::istream> m_source_memory;
- std::istream* m_source_p;
std::istream& m_source;
size_t m_total_read;
};