RTEMS | cpukit/libblock: Fix resource leak in rtems_fdisk_initialize (!903)

MITHILESH MATTAPALLI (@mithileshm) gitlab at rtems.org
Fri Mar 13 13:28:21 UTC 2026




MITHILESH MATTAPALLI commented on a discussion on cpukit/libblock/src/flashdisk.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/903#note_145332

 > +    if ( p->devices ) {
 > +      for ( d = 0; d < p->device_count; d++ ) {
 > +        free( p->devices[ d ].segments );
 > +      }
 > +      free( p->devices );
 > +    }
 > +    free( p->blocks );
 > +    free( p->copy_buffer );
 > +  }
 > +
 > +  if ( fd ) {
 > +    uint32_t d;
 > +
 > +    if ( fd->devices ) {
 > +      for ( d = 0; d < fd->device_count; d++ ) {
 > +        free( fd->devices[ d ].segments );

Same as above, since we're just indexing into the existing `fds` array here, it won't be NULL.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/903#note_145332
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/20260313/d9bacfd7/attachment-0001.htm>


More information about the bugs mailing list