mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
Merge pull request #957 from PhenomRetroShare/Fix_CppCheckerError
Fix cpp checker error
This commit is contained in:
commit
34ddf71703
5 changed files with 19 additions and 6 deletions
|
@ -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)
|
||||||
|
@ -1207,13 +1207,17 @@ bool p3IdService::encryptData( const uint8_t* decrypted_data,
|
||||||
for( int i=0; i < maxRounds; ++i )
|
for( int i=0; i < maxRounds; ++i )
|
||||||
{
|
{
|
||||||
for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin();
|
for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin();
|
||||||
it !=keyNotYetFoundIds.end(); ++it )
|
it !=keyNotYetFoundIds.end(); )
|
||||||
{
|
{
|
||||||
RsTlvPublicRSAKey encryption_key;
|
RsTlvPublicRSAKey encryption_key;
|
||||||
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);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1336,14 +1340,18 @@ bool p3IdService::decryptData( const uint8_t* encrypted_data,
|
||||||
for( int i=0; i < maxRounds; ++i )
|
for( int i=0; i < maxRounds; ++i )
|
||||||
{
|
{
|
||||||
for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin();
|
for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin();
|
||||||
it !=keyNotYetFoundIds.end(); ++it )
|
it !=keyNotYetFoundIds.end(); )
|
||||||
{
|
{
|
||||||
RsTlvPrivateRSAKey decryption_key;
|
RsTlvPrivateRSAKey decryption_key;
|
||||||
if( getPrivateKey(**it, decryption_key)
|
if( getPrivateKey(**it, decryption_key)
|
||||||
&& !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);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ void ContentValue::put(const std::string &key, uint32_t len, const char* value){
|
||||||
mKvData.insert(std::pair<std::string, std::pair<uint32_t, char*> >
|
mKvData.insert(std::pair<std::string, std::pair<uint32_t, char*> >
|
||||||
(key, std::pair<uint32_t, char*>(len, dest)));
|
(key, std::pair<uint32_t, char*>(len, dest)));
|
||||||
//delete[] dest; //Deleted by clearData()
|
//delete[] dest; //Deleted by clearData()
|
||||||
|
// cppcheck-suppress memleak
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentValue::getAsBool(const std::string &key, bool& value) const{
|
bool ContentValue::getAsBool(const std::string &key, bool& value) const{
|
||||||
|
|
|
@ -128,6 +128,8 @@ RsRegularExpression::Expression * AdvancedSearchDialog::getRsExpr()
|
||||||
|
|
||||||
|
|
||||||
// iterate through the items in elements and
|
// iterate through the items in elements and
|
||||||
|
#warning Phenom (2017-07-21): I don't know if it is a real memLeak for wholeExpression. If not remove this warning and add a comment how it is deleted.
|
||||||
|
// cppcheck-suppress memleak
|
||||||
for (int i = 1; i < expressions->size(); ++i) {
|
for (int i = 1; i < expressions->size(); ++i) {
|
||||||
// extract the expression information and compound it with the
|
// extract the expression information and compound it with the
|
||||||
// first expression
|
// first expression
|
||||||
|
|
|
@ -395,7 +395,7 @@ ChatPage::load()
|
||||||
// load personal invites
|
// load personal invites
|
||||||
//
|
//
|
||||||
#ifdef TO_BE_DONE
|
#ifdef TO_BE_DONE
|
||||||
for()
|
for(;;)
|
||||||
{
|
{
|
||||||
QListWidgetItem *item = new QListWidgetItem;
|
QListWidgetItem *item = new QListWidgetItem;
|
||||||
item->setData(Qt::DisplayRole,tr("Private chat invite from")+" "+QString::fromUtf8(detail.name.c_str())) ;
|
item->setData(Qt::DisplayRole,tr("Private chat invite from")+" "+QString::fromUtf8(detail.name.c_str())) ;
|
||||||
|
|
|
@ -25,6 +25,8 @@ element * cons(element *new, element *list) {
|
||||||
element *reverse(element *list) {
|
element *reverse(element *list) {
|
||||||
element *new = NULL;
|
element *new = NULL;
|
||||||
element *next = NULL;
|
element *next = NULL;
|
||||||
|
#warning Phenom (2017-07-21): I don't know if it is a real memLeak for new. If not remove this warning and add a comment how it is deleted.
|
||||||
|
// cppcheck-suppress memleak
|
||||||
while (list != NULL) {
|
while (list != NULL) {
|
||||||
next = list->next;
|
next = list->next;
|
||||||
new = cons(list, new);
|
new = cons(list, new);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue