From a1aad5d165ab5b16937ff2a15d307fc9565a1ffb Mon Sep 17 00:00:00 2001 From: Louis-Bertrand Varin Date: Sat, 14 Oct 2017 22:12:45 -0400 Subject: [PATCH] Using QScopedPointer --- src/gui/DatabaseOpenWidget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index fee0c26ee..19e9a3f4b 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -162,8 +162,8 @@ void DatabaseOpenWidget::enterKey(const QString& pw, const QString& keyFile) void DatabaseOpenWidget::openDatabase() { KeePass2Reader reader; - CompositeKey* masterKey = databaseKey(); - if (masterKey == nullptr) { + QScopedPointer masterKey(databaseKey()); + if (masterKey.isNull()) { return; } @@ -190,8 +190,6 @@ void DatabaseOpenWidget::openDatabase() MessageWidget::Error); m_ui->editPassword->clear(); } - - delete masterKey; } CompositeKey* DatabaseOpenWidget::databaseKey()