MITHILESH MATTAPALLI created a merge request: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/903

Project:Branches: mithileshm/rtems:fix-flashdisk-leak to rtems/rtos/rtems:main
Author:   MITHILESH MATTAPALLI




Coverity Scan reported a resource leak in `rtems_fdisk_initialize`.

The function allocates memory for the `fd` array but iterates the pointer `fd` 
during initialization. If subsequent allocations (like `copy_buffer` or 
`blocks`) fail, the function returns without freeing the original allocated 
memory.

This patch saves the base pointer `fds` at the start and ensures it is freed in 
all error handling paths.

Closes CID 1439298.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/903
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to