Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions include/falcosecurity/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ class table_entry
{
public:
FALCOSECURITY_INLINE
table_entry() { m_entry = nullptr; };
FALCOSECURITY_INLINE
table_entry(table_entry&& o)
{
m_entry = o.m_entry;
Expand All @@ -170,6 +172,7 @@ class table_entry
FALCOSECURITY_INLINE
table_entry& operator=(table_entry&& o)
{
release_entry();
m_entry = o.m_entry;
m_table = o.m_table;
m_reader = o.m_reader;
Expand All @@ -181,13 +184,7 @@ class table_entry
FALCOSECURITY_INLINE
table_entry& operator=(const table_entry&) = delete;
FALCOSECURITY_INLINE
~table_entry()
{
if(m_entry && m_reader->m_reader)
{
m_reader->m_reader->release_table_entry(m_table, m_entry);
}
}
~table_entry() { release_entry(); }

FALCOSECURITY_INLINE
table_entry(_internal::ss_plugin_table_entry_t* e,
Expand All @@ -205,6 +202,16 @@ class table_entry
}

private:
FALCOSECURITY_INLINE
void release_entry()
{
if(m_entry && m_reader->m_reader)
{
m_reader->m_reader->release_table_entry(m_table, m_entry);
m_entry = nullptr;
}
}

_internal::ss_plugin_table_entry_t* m_entry;
_internal::ss_plugin_table_t* m_table;
const table_reader* m_reader;
Expand Down