diff --git a/lib/libimhex/include/hex/pattern_language/ast/ast_node_attribute.hpp b/lib/libimhex/include/hex/pattern_language/ast/ast_node_attribute.hpp index 684d480f4..93d4dda91 100644 --- a/lib/libimhex/include/hex/pattern_language/ast/ast_node_attribute.hpp +++ b/lib/libimhex/include/hex/pattern_language/ast/ast_node_attribute.hpp @@ -44,8 +44,10 @@ namespace hex::pl { Attributable(const Attributable &other) { for (auto &attribute : other.m_attributes) { auto copy = attribute->clone(); - if (auto node = dynamic_cast(copy.get())) + if (auto node = dynamic_cast(copy.get())) { this->m_attributes.push_back(std::unique_ptr(node)); + (void)copy.release(); + } } }