From d74820743dbb9bd5dd1ef103d4f047cd6b7a5666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 17 Apr 2024 09:36:57 +0200 Subject: [PATCH] Fix destructing libdnf::TransactionItem from a base class Resolves: RHEL-26240 --- ...irtual-destructor-to-TransactionItem.patch | 40 +++++++++++++++++++ libdnf.spec | 2 + 2 files changed, 42 insertions(+) create mode 100644 0011-Add-virtual-destructor-to-TransactionItem.patch diff --git a/0011-Add-virtual-destructor-to-TransactionItem.patch b/0011-Add-virtual-destructor-to-TransactionItem.patch new file mode 100644 index 0000000..ecd4bbd --- /dev/null +++ b/0011-Add-virtual-destructor-to-TransactionItem.patch @@ -0,0 +1,40 @@ +From 74150bafa1ffb8527e8eef7507da50562bcb9983 Mon Sep 17 00:00:00 2001 +From: Nicola Sella +Date: Tue, 26 Mar 2024 14:35:43 +0100 +Subject: [PATCH] Add virtual destructor to TransactionItem +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream commit: e4e90777f789fc45e002b4c0385c0565a76be946 +Resolves: https://issues.redhat.com/browse/RHEL-26240 + +Signed-off-by: Petr Písař +--- + libdnf/transaction/TransactionItem.hpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libdnf/transaction/TransactionItem.hpp b/libdnf/transaction/TransactionItem.hpp +index 72684f73..5addad45 100644 +--- a/libdnf/transaction/TransactionItem.hpp ++++ b/libdnf/transaction/TransactionItem.hpp +@@ -43,6 +43,8 @@ namespace libdnf { + + class TransactionItemBase { + public: ++ virtual ~TransactionItemBase() = default; ++ + ItemPtr getItem() const noexcept { return item; } + void setItem(ItemPtr value) { item = value; } + +@@ -101,6 +103,7 @@ public: + explicit TransactionItem(Transaction *trans); + + TransactionItem(SQLite3Ptr conn, int64_t transID); ++ virtual ~TransactionItem() = default; + + int64_t getId() const noexcept { return id; } + void setId(int64_t value) { id = value; } +-- +2.44.0 + diff --git a/libdnf.spec b/libdnf.spec index 4551170..e6f4565 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -73,6 +73,7 @@ Patch7: 0007-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch Patch8: 0008-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch Patch9: 0009-Replace-assert-by-map_grow.patch Patch10: 0010-subject-py-Fix-memory-leak.patch +Patch11: 0011-Add-virtual-destructor-to-TransactionItem.patch BuildRequires: cmake @@ -326,6 +327,7 @@ popd - Grow memory if applying a query after increasing a number of available packages (RHEL-27657) - Fix a memory leak in get_best_solution() (RHEL-26226) +- Fix destructing libdnf::TransactionItem from a base class (RHEL-26240) * Wed Oct 25 2023 Petr Pisar - 0.69.0-8 - Set default SELinux labels on GnuPG directories (RHEL-11238)