From ba33649d7ef3fa1771bb29d9704d7bef36d40542 Mon Sep 17 00:00:00 2001 From: thotbot Date: Thu, 18 Jul 2019 13:22:38 +0000 Subject: [PATCH] Fix segfault on Tails --- src/qt/MoneroSettings.cpp | 3 ++- src/qt/MoneroSettings.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qt/MoneroSettings.cpp b/src/qt/MoneroSettings.cpp index ba3e6876..1de786a6 100644 --- a/src/qt/MoneroSettings.cpp +++ b/src/qt/MoneroSettings.cpp @@ -147,7 +147,8 @@ void MoneroSettings::reset() { if (this->m_initialized && this->m_settings && !this->m_changedProperties.isEmpty()) this->store(); - delete this->m_settings; + if (this->m_settings) + delete this->m_settings; } void MoneroSettings::store() diff --git a/src/qt/MoneroSettings.h b/src/qt/MoneroSettings.h index 6de7f641..cda22e02 100644 --- a/src/qt/MoneroSettings.h +++ b/src/qt/MoneroSettings.h @@ -72,7 +72,7 @@ private: void store(); QHash m_changedProperties; - QSettings *m_settings; + QSettings *m_settings = NULL; QString m_fileName = QString(""); bool m_initialized = false; int m_timerId = 0;