Skip to content

Commit e080206

Browse files
committed
Fix potential for a memory leak in directory_iterator
1 parent b5f99c2 commit e080206

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/connection_unix.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class directory_iterator {
8787
explicit operator bool() const noexcept { return m_stream != nullptr; }
8888
bool open()
8989
{
90+
close();
9091
m_stream = opendir(m_path.c_str());
9192
return m_stream != nullptr;
9293
}

0 commit comments

Comments
 (0)