Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#4297 closed defect (fixed)

rtems-fdt.c: Resource leak error spotted by Coverity

Reported by: Ryan Long Owned by: Ryan Long <ryan.long@…>
Priority: normal Milestone: Indefinite
Component: lib Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

CID 1437645: Resource leak in rtems_fdt_load().

607  if (fe < 0)
608  {
609    free (blob);
610    close (bf);
611    return fe;
612  }
613
   CID 1437645 (#1-2 of 2): Resource leak (RESOURCE_LEAK)33. leaked_handle: Handle variable bf going out of scope leaks the handle.
614  return 0;
615}

Change History (2)

comment:1 Changed on 12/16/21 at 21:37:54 by Ryan Long

Milestone: 6.1Indefinite

comment:2 Changed on 12/17/21 at 16:21:29 by Ryan Long <ryan.long@…>

Owner: set to Ryan Long <ryan.long@…>
Resolution: fixed
Status: newclosed

In [changeset:"98ab69323ea3799dbd1c418517c72526af699c5a/rtems" 98ab693/rtems]:

libmisc/rtems-fdt: close() file 'bf'

close() file 'bf' to avoid leaking descriptor.

CID 1437645: Resource leak in rtems_fdt_load().

Closes #4297

Note: See TracTickets for help on using tickets.