Mellanox/mstflint

malloc() allocations released with delete in mlxlink/modules/mlxlink_cables_commander.cpp

tzafrir-mellanox opened this issue · 0 comments

mstflint 4.16.0 fails to build on current Debian development version (using gcc 11). Same problem with 4.17.0 .

Example error message:
mlxlink_cables_commander.cpp:386:41: note: returned from ‘void* malloc(size_t)’
386 | u_int8_t page0L = (u_int8_t)malloc(sizeof(u_int8_t) * CABLE_PAGE_SIZE);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mlxlink_cables_commander.cpp: In member function ‘void MlxlinkCablesCommander::readCableDDMInfo()’:
mlxlink_cables_commander.cpp:638:12: error: ‘void operator delete(void*, std::size_t)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
638 | delete thresholdPage;

See further details and link to logs in https://bugs.debian.org/984247