From 2880ca00da358abbc423660c9ea4d19f5c80429b Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 3 Mar 2022 11:19:46 +0100 Subject: [PATCH] patterns: Fixed crash when using attributes --- .../include/hex/pattern_language/ast/ast_node_attribute.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); + } } }