[RTEMS Project] #4299: flashdisk.c: Resource leak error spotted by Coverity
RTEMS trac
trac at rtems.org
Thu Mar 4 16:59:50 UTC 2021
#4299: flashdisk.c: Resource leak error spotted by Coverity
------------------------+--------------------
Reporter: Ryan Long | Owner: (none)
Type: defect | Status: new
Priority: normal | Milestone: 6.1
Component: lib/block | Version: 6
Severity: normal | Keywords:
Blocked By: | Blocking:
------------------------+--------------------
CID 1439298: Resource leak in rtems_fdisk_initialize().
{{{
2497 fd->devices = calloc (c->device_count, sizeof
(rtems_fdisk_device_ctl));
15. Condition !fd->devices, taking true branch.
2498 if (!fd->devices)
CID 1439298 (#2 of 2): Resource leak (RESOURCE_LEAK)16.
leaked_storage: Variable fd going out of scope leaks the storage it points
to.
2499 return RTEMS_NO_MEMORY;
2500
2501 rtems_mutex_init (&fd->lock, "Flash Disk");
}}}
--
Ticket URL: <http://devel.rtems.org/ticket/4299>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list