┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authorDavid Hallas <[email protected]>2018-07-18 16:43:25 -0600
committerNathaniel Graham <[email protected]>2018-07-18 16:48:07 -0600
commitf186124f0e2c1a2b82687ad394f4df1acf5f8d61 (patch)
treeb6dfabbd958f04323ec7b1c29442509e02fd67ef /src/dolphincontextmenu.cpp
parente6bf758406f6e009f860271785c97c29859dd199 (diff)
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
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 7d7d7a408..8fdaab1d0 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;
}