[Pkg-owncloud-commits] [owncloud-client] 68/159: AccountState: Fix uninitialized memory access spotted by valgrind

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri May 1 13:05:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit f4e2c8411133e2002232b26da12d534afa1c7976
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Apr 6 16:20:28 2015 +0200

    AccountState: Fix uninitialized memory access spotted by valgrind
    
    QuotaInfo's constructor uses the AccountState's _state which is
    initialized after
---
 src/gui/accountstate.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp
index 0ccbfbc..43f8762 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -56,13 +56,15 @@ void AccountStateManager::slotAccountAdded(AccountPtr account)
 AccountState::AccountState(AccountPtr account)
     : QObject(account.data())
     , _account(account)
-    , _quotaInfo(new QuotaInfo(this))
+    , _quotaInfo(0)
     , _state(AccountState::Disconnected)
     , _connectionStatus(ConnectionValidator::Undefined)
     , _waitingForNewCredentials(false)
 {
     qRegisterMetaType<AccountState*>("AccountState*");
 
+    _quotaInfo = new QuotaInfo(this); // Need to be initialized when 'this' is fully initialized
+
     connect(account.data(), SIGNAL(invalidCredentials()),
             SLOT(slotInvalidCredentials()));
     connect(account.data(), SIGNAL(credentialsFetched(AbstractCredentials*)),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list