Skip to content

Commit

Permalink
fix: release with move operator
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Aug 6, 2024
1 parent 1c46ba0 commit fbd8d62
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions include/falcosecurity/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,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 @@ -183,10 +184,7 @@ class table_entry
FALCOSECURITY_INLINE
~table_entry()
{
if(m_entry && m_reader->m_reader)
{
m_reader->m_reader->release_table_entry(m_table, m_entry);
}
release_entry();
}

FALCOSECURITY_INLINE
Expand All @@ -205,6 +203,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);
}
}

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

0 comments on commit fbd8d62

Please sign in to comment.