summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'kde-apps/dolphin/files')
-rw-r--r--kde-apps/dolphin/files/dolphin-18.04.3-memleak-1.patch36
-rw-r--r--kde-apps/dolphin/files/dolphin-18.04.3-memleak-2.patch37
2 files changed, 73 insertions, 0 deletions
diff --git a/kde-apps/dolphin/files/dolphin-18.04.3-memleak-1.patch b/kde-apps/dolphin/files/dolphin-18.04.3-memleak-1.patch
new file mode 100644
index 000000000000..5bbeaa7e617c
--- /dev/null
+++ b/kde-apps/dolphin/files/dolphin-18.04.3-memleak-1.patch
@@ -0,0 +1,36 @@
+From 4536e25ac929d8d37ffbbba0642de662bcc9f891 Mon Sep 17 00:00:00 2001
+From: David Hallas <david@davidhallas.dk>
+Date: Wed, 18 Jul 2018 23:20:18 +0200
+Subject: Fixes memory leak in KItemListViewAccessible
+
+Summary: The KItemListViewAccessible class has a list of QAccessibleInterface pointers in a member variable m_cells. The problem is that when new entries are created, the newly allocated pointer is not stored in the list, only a nullptr is store, this renders the cleanup code in the destructor useless. This patch simply stores the pointer in the list, causing the destructor to correctly free the memory.
+
+Test Plan: I found this issue using address sanitizer. Simply building Dolphin with -fsanitize=address and opening a window caused the memory leak.
+
+Reviewers: #dolphin, jtamate, elvisangelaccio
+
+Reviewed By: #dolphin, jtamate, elvisangelaccio
+
+Subscribers: elvisangelaccio, kfm-devel
+
+Tags: #dolphin
+
+Differential Revision: https://phabricator.kde.org/D14168
+---
+ src/kitemviews/kitemlistviewaccessible.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/kitemviews/kitemlistviewaccessible.cpp b/src/kitemviews/kitemlistviewaccessible.cpp
+index 69c126f..4d1b28b 100644
+--- a/src/kitemviews/kitemlistviewaccessible.cpp
++++ b/src/kitemviews/kitemlistviewaccessible.cpp
+@@ -78,6 +78,7 @@ QAccessibleInterface* KItemListViewAccessible::cell(int index) const
+ QAccessibleInterface* child = m_cells.at(index);
+ if (!child) {
+ child = new KItemListAccessibleCell(view(), index);
++ m_cells.insert(index, child);
+ QAccessible::registerAccessibleInterface(child);
+ }
+ return child;
+--
+cgit v0.11.2
diff --git a/kde-apps/dolphin/files/dolphin-18.04.3-memleak-2.patch b/kde-apps/dolphin/files/dolphin-18.04.3-memleak-2.patch
new file mode 100644
index 000000000000..f39885bdca36
--- /dev/null
+++ b/kde-apps/dolphin/files/dolphin-18.04.3-memleak-2.patch
@@ -0,0 +1,37 @@
+From 2cbf3cb11ea668577121fa755c1ddacc6f0acdd8 Mon Sep 17 00:00:00 2001
+From: David Hallas <david@davidhallas.dk>
+Date: Wed, 18 Jul 2018 16:43:25 -0600
+Subject: Fixes small memory leak in DolphinContextMenu
+
+Summary: When DolphinContextMenu::baseFileItem is called a KFileItem is allocated and stored in DolphinContextMenu::m_baseFileItem, which is of type KFileItem*, but the destructor failed to delete this.
+
+Test Plan: This leak was found using Address Sanitizer
+
+Reviewers: broulik, elvisangelaccio
+
+Reviewed By: broulik, elvisangelaccio
+
+Subscribers: ngraham, kfm-devel
+
+Tags: #dolphin
+
+Differential Revision: https://phabricator.kde.org/D14178
+---
+ src/dolphincontextmenu.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
+index 7d7d7a4..8fdaab1 100644
+--- a/src/dolphincontextmenu.cpp
++++ b/src/dolphincontextmenu.cpp
+@@ -81,6 +81,8 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
+
+ DolphinContextMenu::~DolphinContextMenu()
+ {
++ delete m_baseFileItem;
++ m_baseFileItem = nullptr;
+ delete m_selectedItemsProperties;
+ m_selectedItemsProperties = nullptr;
+ }
+--
+cgit v0.11.2