From 2b3f6c607bf5eb7c6b24160832ba83ed60dca543 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 10 Sep 2018 06:49:14 -0700 Subject: prefs: cloud_new_password is not a preference It's a mamber of the cloud storage authentication class, used to hold the proposed new password until the backend has accepted it. Signed-off-by: Dirk Hohndel --- core/cloudstorage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/cloudstorage.cpp') diff --git a/core/cloudstorage.cpp b/core/cloudstorage.cpp index 51bdf5994..24a536992 100644 --- a/core/cloudstorage.cpp +++ b/core/cloudstorage.cpp @@ -26,6 +26,7 @@ QNetworkReply* CloudStorageAuthenticate::backend(const QString& email,const QStr } else if (!newpasswd.isEmpty()) { requestUrl = QUrl(CLOUDBACKENDUPDATE); payload += QChar(' ') + newpasswd; + cloudNewPassword = newpasswd; } else { requestUrl = QUrl(CLOUDBACKENDVERIFY); payload += QChar(' ') + pin; @@ -64,8 +65,8 @@ void CloudStorageAuthenticate::uploadFinished() report_error(qPrintable(tr("Cloud account verification required, enter PIN in preferences"))); } else if (cloudAuthReply == QLatin1String("[PASSWDCHANGED]")) { free((void *)prefs.cloud_storage_password); - prefs.cloud_storage_password = prefs.cloud_storage_newpassword; - prefs.cloud_storage_newpassword = NULL; + prefs.cloud_storage_password = strdup(qPrintable(cloudNewPassword)); + cloudNewPassword.clear(); emit passwordChangeSuccessful(); return; } else { -- cgit v1.2.3-70-g09d2