Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-02-08 14:30:32 +0300
committerOlivier Goffart <ogoffart@woboq.com>2017-02-08 14:31:07 +0300
commit06579a5c709ed4f9399c7924281bfe1c50785486 (patch)
tree727003897176164fc504b8421b861c4851911f03 /src/gui/accountmanager.cpp
parentdf773ea8bbf0eaf03f7cffca37f6637a2e018ff2 (diff)
AccountManager: Fix small leak in the account migration code
The QSettings object was not deleted in every possible code paths
Diffstat (limited to 'src/gui/accountmanager.cpp')
-rw-r--r--src/gui/accountmanager.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp
index fdb77b8f8..9d8b3ed41 100644
--- a/src/gui/accountmanager.cpp
+++ b/src/gui/accountmanager.cpp
@@ -86,7 +86,7 @@ bool AccountManager::restoreFromLegacySettings()
QFileInfo fi( oCCfgFile );
if( fi.isReadable() ) {
- QSettings *oCSettings = new QSettings(oCCfgFile, QSettings::IniFormat);
+ std::unique_ptr<QSettings> oCSettings(new QSettings(oCCfgFile, QSettings::IniFormat));
oCSettings->beginGroup(QLatin1String("ownCloud"));
// Check the theme url to see if it is the same url that the oC config was for
@@ -101,9 +101,7 @@ bool AccountManager::restoreFromLegacySettings()
qDebug() << "Migrate oC config if " << oCUrl << " == " << overrideUrl << ":"
<< (oCUrl == overrideUrl ? "Yes" : "No");
if( oCUrl == overrideUrl ) {
- settings.reset( oCSettings );
- } else {
- delete oCSettings;
+ settings = std::move(oCSettings);
}
}
}