RTEMS | cpukit/libblock: Fix resource leak in rtems_nvdisk_initialize (CID 1439297) (!905)
MITHILESH MATTAPALLI (@mithileshm)
gitlab at rtems.org
Tue Jan 13 20:42:07 UTC 2026
MITHILESH MATTAPALLI created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/905
Project:Branches: mithileshm/rtems:fix-nvdisk-leak to rtems/rtos/rtems:main
Author: MITHILESH MATTAPALLI
## Summary
cpukit/libblock: Fix resource leak in rtems_nvdisk_initialize (CID 1439297)
The function allocates memory for the nvd array but iterates the pointer
during initialization. If subsequent allocations fail, the function
returns without freeing the original allocated memory.
This patch saves the base pointer nvd_start and ensures it is freed
in error handling paths.
CID 1439297
<!-- Default settings, if it is a dropdown it will set after submission -->
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/905
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/20260113/bfe0c074/attachment.htm>
More information about the bugs
mailing list