Fix destructing libdnf::TransactionItem from a base class

Resolves: RHEL-26240
This commit is contained in:
Petr Písař 2024-04-17 09:36:57 +02:00
parent 8b5fc624b3
commit d74820743d
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From 74150bafa1ffb8527e8eef7507da50562bcb9983 Mon Sep 17 00:00:00 2001
From: Nicola Sella <nsella@redhat.com>
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ř <ppisar@redhat.com>
---
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

View File

@ -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 Patch8: 0008-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch
Patch9: 0009-Replace-assert-by-map_grow.patch Patch9: 0009-Replace-assert-by-map_grow.patch
Patch10: 0010-subject-py-Fix-memory-leak.patch Patch10: 0010-subject-py-Fix-memory-leak.patch
Patch11: 0011-Add-virtual-destructor-to-TransactionItem.patch
BuildRequires: cmake BuildRequires: cmake
@ -326,6 +327,7 @@ popd
- Grow memory if applying a query after increasing a number of available - Grow memory if applying a query after increasing a number of available
packages (RHEL-27657) packages (RHEL-27657)
- Fix a memory leak in get_best_solution() (RHEL-26226) - 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 <ppisar@redhat.com> - 0.69.0-8 * Wed Oct 25 2023 Petr Pisar <ppisar@redhat.com> - 0.69.0-8
- Set default SELinux labels on GnuPG directories (RHEL-11238) - Set default SELinux labels on GnuPG directories (RHEL-11238)