Raspberry-PICO2040-Flash-Storage
Raspberry-PICO2040-Flash-Storage copied to clipboard
Memory leak
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.