diff options
Diffstat (limited to 'core/cloudstorage.cpp')
-rw-r--r-- | core/cloudstorage.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 { |