summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2017-07-19 10:13:12 +0200
committerDavid Faure <[email protected]>2017-07-19 10:14:37 +0200
commit4ed67e11d262c0c6cc542f9f7e8e52ce57d8c648 (patch)
tree67557a25ec16ec30ea65c2209ed1b8359a045b55
parent6a4019923dbb8be7e2623337e95154527cf707cb (diff)
Fix crash when clicking on "try again".v17.07.80
==6895== Invalid read of size 8 ==6895== at 0x9294220: KPasswordDialog::password() const (kpassworddialog.cpp:201) ==6895== by 0x42AFDD: SettingsPasswordRequester::requestManualAuth(bool*) (settingspasswordrequester.cpp:174) ==6895== Address 0x2f34cc50 is 48 bytes inside a block of size 56 free'd ==6895== at 0x4C2A69D: operator delete(void*) (vg_replace_malloc.c:576) ==6895== by 0x929342D: KPasswordDialog::~KPasswordDialog() (kpassworddialog.cpp:80) ==6895== by 0xA9C83E2: QDialog::exec() (qdialog.cpp:540) ==6895== by 0x42AF7F: SettingsPasswordRequester::requestManualAuth(bool*) (settingspasswordrequester.cpp:172) CCMAIL: [email protected]
-rw-r--r--resources/imap/settingspasswordrequester.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/resources/imap/settingspasswordrequester.cpp b/resources/imap/settingspasswordrequester.cpp
index 1046b3a..a8d6a34 100644
--- a/resources/imap/settingspasswordrequester.cpp
+++ b/resources/imap/settingspasswordrequester.cpp
@@ -164,11 +164,10 @@ void SettingsPasswordRequester::onPasswordRequestCompleted(const QString &passwo
QString SettingsPasswordRequester::requestManualAuth(bool* userRejected)
{
- KPasswordDialog *dlg = new KPasswordDialog(nullptr);
+ QScopedPointer<KPasswordDialog> dlg(new KPasswordDialog(nullptr));
dlg->setModal(true);
dlg->setPrompt(i18n("Please enter password for user '%1' on IMAP server '%2'.",
m_resource->settings()->userName(), m_resource->settings()->imapServer()));
- dlg->setAttribute(Qt::WA_DeleteOnClose);
if (dlg->exec()) {
if (userRejected) *userRejected = false;
m_resource->settings()->setPassword(dlg->password());