diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index a1dfc51d5..8695280a7 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -425,7 +425,7 @@ public: bool no_ts = (it == mLastUsageTS.end()) ; 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 ; if(no_ts) @@ -1207,13 +1207,17 @@ bool p3IdService::encryptData( const uint8_t* decrypted_data, for( int i=0; i < maxRounds; ++i ) { for( std::set::iterator it = keyNotYetFoundIds.begin(); - it !=keyNotYetFoundIds.end(); ++it ) + it !=keyNotYetFoundIds.end(); ) { RsTlvPublicRSAKey encryption_key; if(getKey(**it, encryption_key) && !encryption_key.keyId.isNull()) { 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( std::set::iterator it = keyNotYetFoundIds.begin(); - it !=keyNotYetFoundIds.end(); ++it ) + it !=keyNotYetFoundIds.end(); ) { RsTlvPrivateRSAKey decryption_key; if( getPrivateKey(**it, decryption_key) && !decryption_key.keyId.isNull() ) { decryption_keys.push_back(decryption_key); - keyNotYetFoundIds.erase(it); + it = keyNotYetFoundIds.erase(it); + } + else + { + ++it; } } diff --git a/libretroshare/src/util/contentvalue.cc b/libretroshare/src/util/contentvalue.cc index fd4a5168b..1ab962120 100644 --- a/libretroshare/src/util/contentvalue.cc +++ b/libretroshare/src/util/contentvalue.cc @@ -185,6 +185,7 @@ void ContentValue::put(const std::string &key, uint32_t len, const char* value){ mKvData.insert(std::pair > (key, std::pair(len, dest))); //delete[] dest; //Deleted by clearData() + // cppcheck-suppress memleak } bool ContentValue::getAsBool(const std::string &key, bool& value) const{ diff --git a/retroshare-gui/src/gui/advsearch/advancedsearchdialog.cpp b/retroshare-gui/src/gui/advsearch/advancedsearchdialog.cpp index d4b629b4b..4eb551a2e 100644 --- a/retroshare-gui/src/gui/advsearch/advancedsearchdialog.cpp +++ b/retroshare-gui/src/gui/advsearch/advancedsearchdialog.cpp @@ -128,6 +128,8 @@ RsRegularExpression::Expression * AdvancedSearchDialog::getRsExpr() // 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) { // extract the expression information and compound it with the // first expression diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 81e54c802..465a7233a 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -395,7 +395,7 @@ ChatPage::load() // load personal invites // #ifdef TO_BE_DONE - for() + for(;;) { QListWidgetItem *item = new QListWidgetItem; item->setData(Qt::DisplayRole,tr("Private chat invite from")+" "+QString::fromUtf8(detail.name.c_str())) ; diff --git a/supportlibs/pegmarkdown/utility_functions.c b/supportlibs/pegmarkdown/utility_functions.c index 50fc35035..08f910274 100644 --- a/supportlibs/pegmarkdown/utility_functions.c +++ b/supportlibs/pegmarkdown/utility_functions.c @@ -25,6 +25,8 @@ element * cons(element *new, element *list) { element *reverse(element *list) { element *new = 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) { next = list->next; new = cons(list, new);