mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 17:28:41 -04:00
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:
parent
2e9d22c580
commit
b13292bb80
11 changed files with 24 additions and 14 deletions
|
@ -96,7 +96,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (fileSize < 1024) {
|
||||
fileSize = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", fileSize / multi);
|
||||
|
@ -115,7 +115,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (remaining < 1024) {
|
||||
remaining = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", remaining / multi);
|
||||
|
@ -134,7 +134,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (completed < 1024) {
|
||||
completed = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", completed / multi);
|
||||
|
|
|
@ -85,7 +85,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (fileSize < 1024) {
|
||||
fileSize = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", fileSize / multi);
|
||||
|
@ -104,7 +104,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (transferred < 1024) {
|
||||
transferred = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", transferred / multi);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue