mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix CppCheck Error in p3idservice.cc
/libretroshare/src/services/p3idservice.cc:1216: error: Cppcheck(eraseDereference): Iterator 'it' used after element has been erased. /libretroshare/src/services/p3idservice.cc:1346: error: Cppcheck(eraseDereference): Iterator 'it' used after element has been erased. /libretroshare/src/services/p3idservice.cc:448: error: Cppcheck(uninitvar): Uninitialized variable: max_keep_time
This commit is contained in:
parent
aa471e5b2f
commit
e5767431e6
@ -425,7 +425,7 @@ public:
|
|||||||
bool no_ts = (it == mLastUsageTS.end()) ;
|
bool no_ts = (it == mLastUsageTS.end()) ;
|
||||||
|
|
||||||
time_t last_usage_ts = no_ts?0:(it->second.TS);
|
time_t last_usage_ts = no_ts?0:(it->second.TS);
|
||||||
time_t max_keep_time ;
|
time_t max_keep_time = 0;
|
||||||
bool should_check = true ;
|
bool should_check = true ;
|
||||||
|
|
||||||
if(no_ts)
|
if(no_ts)
|
||||||
@ -1213,7 +1213,7 @@ bool p3IdService::encryptData( const uint8_t* decrypted_data,
|
|||||||
if(getKey(**it, encryption_key) && !encryption_key.keyId.isNull())
|
if(getKey(**it, encryption_key) && !encryption_key.keyId.isNull())
|
||||||
{
|
{
|
||||||
encryption_keys.push_back(encryption_key);
|
encryption_keys.push_back(encryption_key);
|
||||||
keyNotYetFoundIds.erase(it);
|
it = keyNotYetFoundIds.erase(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1343,7 +1343,7 @@ bool p3IdService::decryptData( const uint8_t* encrypted_data,
|
|||||||
&& !decryption_key.keyId.isNull() )
|
&& !decryption_key.keyId.isNull() )
|
||||||
{
|
{
|
||||||
decryption_keys.push_back(decryption_key);
|
decryption_keys.push_back(decryption_key);
|
||||||
keyNotYetFoundIds.erase(it);
|
it = keyNotYetFoundIds.erase(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user