From a9a637454a7dfe8fb5d6f0db811648086bda3f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 9 Apr 2018 16:07:44 +0100 Subject: [PATCH] Fix a memory leak in SmartParser. CC: caiojcarvalho@gmail.com --- src/core/smartparser.cpp | 5 +++++ src/core/smartparser.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/core/smartparser.cpp b/src/core/smartparser.cpp index 7213355..294691e 100644 --- a/src/core/smartparser.cpp +++ b/src/core/smartparser.cpp @@ -39,6 +39,11 @@ SmartParser::SmartParser(const QString &device_path) : { } +SmartParser::~SmartParser() +{ + delete m_DiskInformation; +} + /** Initialize SmartParser data, retrieve the information from SMART JSON and initialize the disk information data */ bool SmartParser::init() { diff --git a/src/core/smartparser.h b/src/core/smartparser.h index a48750c..417bd90 100644 --- a/src/core/smartparser.h +++ b/src/core/smartparser.h @@ -33,6 +33,7 @@ class SmartParser { public: SmartParser(const QString &device_path); + ~SmartParser(); public: bool init();