#1690 closed defect (fixed)

ramdisk leaks memory

Reported by: Ralf Corsepius Owned by: Chris Johns
Priority: normal Milestone: 4.11
Component: fs Version: 4.11
Severity: normal Keywords:
Cc: sebastian.huber@… Blocked By:
Blocking:

Description

In http://scan2.coverity.com:9104/cov.cgi?cid=26

JoelSherrill? wrote on 2010-01-19 03:17:

This is allocating memory for a RAM disk which will persist for the life of the system. RTEMS has no "de-initialize" driver call so there is no corresponding free(r).

Later this was closed as "Ignore"/"Intentional"

Though I agree that closing this CID this way is appropriate,
I think this actually needs fixing in longer term.

Context:
cpukit/libblock/src/ramdisk-config.c:
...
ramdisk_initialize()
...
Event alloc_fn: Calling allocation function "calloc".
Event var_assign: Assigning: "r" = storage returned from "calloc(rtems_ramdisk_configuration_size, sizeof (struct ramdisk) /*16*/)".
49 r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
50 r->trace = false;
...
Event leaked_storage: Variable "r" going out of scope leaks the storage it points to.
89 return RTEMS_SUCCESSFUL;

Change History (3)

comment:1 Changed on Aug 26, 2010 at 8:13:56 AM by Sebastian Huber

Cc: Sebastian Huber added

comment:2 Changed on Mar 13, 2012 at 11:55:36 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

comment:3 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

Note: See TracTickets for help on using tickets.