#4299 new defect

flashdisk.c: Resource leak error spotted by Coverity

Reported by: Ryan Long Owned by:
Priority: normal Milestone: Indefinite
Component: lib/block Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

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");

Change History (1)

comment:1 Changed on 12/16/21 at 20:40:33 by Ryan Long

Milestone: 6.1Indefinite
Note: See TracTickets for help on using tickets.