┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hallas <[email protected]>2018-07-18 16:43:25 -0600
committerNathaniel Graham <[email protected]>2018-07-19 08:25:12 -0600
commit2cbf3cb11ea668577121fa755c1ddacc6f0acdd8 (patch)
treed428c5c58acac70cdc8a6f16a0569cbb91ab1823
parent80bc133da937e5351e5ed95443093ec1efac5640 (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
-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;
}