RTEMS | cpukit/libblock: Fix resource leak in rtems_fdisk_initialize (!903)
Kinsey Moore (@opticron)
gitlab at rtems.org
Thu Jan 15 22:57:17 UTC 2026
Kinsey Moore started a new discussion on cpukit/libblock/src/flashdisk.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/903#note_138824
> * One copy buffer of a page size.
> */
> fd->copy_buffer = malloc (c->block_size);
> - if (!fd->copy_buffer)
> + if (!fd->copy_buffer) {
> + free (fds);
If this fails, it needs to go through the previous file descriptors that were already iterated over and release their memory in copy_buffer as well.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/903#note_138824
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260115/f1c90c04/attachment-0001.htm>
More information about the bugs
mailing list