Fix error reported by CppChecker:

/libretroshare/src/gxs/rsgenexchange.cc:2850: erreur : Cppcheck:
Dereferencing 'grp' after it is deallocated / released
/libretroshare/src/gxstunnel/p3gxstunnel.cc:1004: erreur : Cppcheck:
Invalid usage of output stream: '<< std::cerr'.
/libretroshare/src/util/contentvalue.cc:185: erreur : Cppcheck: Memory
leak: dest
/openpgpsdk/src/openpgpsdk/reader_armoured.c:575: erreur : Cppcheck:
Common realloc mistake: 'buf' nulled but not freed upon failure
/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp:103: erreur :
Cppcheck: Array 'byteUnits[4]' accessed at index 4, which is out of
bounds.
/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp:122: erreur :
Cppcheck: Array 'byteUnits[4]' accessed at index 4, which is out of
bounds.
/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp:141: erreur :
Cppcheck: Array 'byteUnits[4]' accessed at index 4, which is out of
bounds.
/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp:92: erreur :
Cppcheck: Array 'byteUnits[4]' accessed at index 4, which is out of
bounds.
/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp:111: erreur :
Cppcheck: Array 'byteUnits[4]' accessed at index 4, which is out of
bounds.
/retroshare-gui/src/gui/People/PeopleDialog.cpp:774: erreur : Cppcheck:
Uninitialized variable: layout
/retroshare-gui/src/gui/People/PeopleDialog.cpp:864: erreur : Cppcheck:
Uninitialized variable: layout
/retroshare-gui/src/gui/common/AvatarWidget.cpp:225: erreur : Cppcheck:
Uninitialized variable: status
/retroshare-nogui/src/rpc/proto/rpcprotostream.cc:805: erreur :
Cppcheck: Memory leak: buffer
/supportlibs/pegmarkdown/GLibFacade.c:150: erreur : Cppcheck: va_list
'args' was opened but not closed by va_end().
/openpgpsdk/src/openpgpsdk/reader_armoured.c:575: erreur : Cppcheck:
Common realloc mistake: 'buf' nulled but not freed upon failure
/tests/unittests/libretroshare/serialiser/rsturtleitem_test.cc:213:
erreur : Cppcheck: Return value of allocation function 'init_item' is
not stored.
This commit is contained in:
Phenom 2016-03-20 12:10:56 +01:00
parent 2e9d22c580
commit b13292bb80
11 changed files with 24 additions and 14 deletions

View file

@ -2844,11 +2844,11 @@ void RsGenExchange::processRecvdGroups()
if(gpsi.mAttempts == VALIDATE_MAX_ATTEMPTS)
{
delete grp;
erase = true;
#ifdef GEN_EXCH_DEBUG
std::cerr << " max attempts " << VALIDATE_MAX_ATTEMPTS << " reached. Will delete group " << grp->grpId << std::endl;
#endif
delete grp;
erase = true;
}
else
{

View file

@ -1001,7 +1001,7 @@ void p3GxsTunnelService::handleRecvDHPublicKey(RsGxsTunnelDHPublicKeyItem *item)
#ifdef DEBUG_GXS_TUNNEL
std::cerr << " DH key computed. Tunnel is now secured!" << std::endl;
std::cerr << " Key computed: " << RsUtil::BinToHex((char*)pinfo.aes_key,16) << std::cerr << std::endl;
std::cerr << " Key computed: " << RsUtil::BinToHex((char*)pinfo.aes_key,16) << std::endl;
std::cerr << " Sending a ACK packet." << std::endl;
#endif

View file

@ -182,6 +182,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*> >
(key, std::pair<uint32_t, char*>(len, dest)));
//delete[] dest; //Deleted by clearData()
}
bool ContentValue::getAsBool(const std::string &key, bool& value) const{