Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a memory leak in Write_To_24LCxx #6

Open
afiskon opened this issue Feb 16, 2018 · 0 comments
Open

There is a memory leak in Write_To_24LCxx #6

afiskon opened this issue Feb 16, 2018 · 0 comments

Comments

@afiskon
Copy link

afiskon commented Feb 16, 2018

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant