There is a memory leak in Write_To_24LCxx
afiskon opened this issue · 0 comments
afiskon commented
for instance, in nucleo-f411RE/src/ch14/main-ex1.c:
data = (uint8_t*)malloc(sizeof(uint8_t)*(len+2));
// ...
/* We are now ready to transfer the buffer over the I2C bus */
returnValue = HAL_I2C_Master_Transmit(hi2c, DevAddress, data, len + 2, HAL_MAX_DELAY);
if(returnValue != HAL_OK)
return returnValue; // <--- !!! you forgot to call free() here
free(data);