Raspberry-PICO2040-Flash-Storage icon indicating copy to clipboard operation
Raspberry-PICO2040-Flash-Storage copied to clipboard

Memory leak

Open supercamel opened this issue 1 year ago • 0 comments

pico_flash_write() assigns memory to stored_value using a call to malloc. Later it assigns stored_value the result of pico_flash_read() without freeing stored_value first.

To be honest, I don't think a library like this shouldn't need to call malloc/calloc at all. Instead just require the user to provide the necessary memory.

supercamel avatar May 08 '23 07:05 supercamel