#3514 assigned defect

Resource Leak in hexdump-parse.c (CID 26032)

Reported by: Joel Sherrill Owned by:
Priority: normal Milestone: Indefinite
Component: shell Version: 6
Severity: normal Keywords: coverity
Cc: Blocked By:
Blocking:

Description

Per Coverity Scan (https://scan.coverity.com/projects/rtems) CID 26032, hexdump-parse.c has a resource leak. You will need an Coverity Scan account and permission to view RTEMS to see more details.

This code came from FreeBSD so a first step would be checking if this area of the code has changed since it was incorporated into RTEMS. The code in question is:

421                }
422                /*
423                 * If format unit byte count not specified, figure it out
424                 * so can adjust rep count later.
425                 */
   	14. Condition !fu->bcnt, taking true branch.
426                if (!fu->bcnt)
   	
CID 26032 (#2 of 2): Resource leak (RESOURCE_LEAK)
15. overwrite_var: Overwriting pr in pr = fu->nextpr leaks the storage that pr points to.
427                        for (pr = fu->nextpr; pr; pr = pr->nextpr)
428                                fu->bcnt += pr->bcnt;
429        }

Change History (3)

comment:1 Changed on Sep 12, 2018 at 3:30:24 PM by Joel Sherrill

Summary: Resource Leak in hexdump-parse.cResource Leak in hexdump-parse.c (CID 26032)

comment:2 Changed on Oct 14, 2018 at 8:25:05 PM by Chris Johns

Owner: set to joel
Status: newassigned

comment:3 Changed on Oct 14, 2018 at 8:34:43 PM by Joel Sherrill

Milestone: 5.1Indefinite
Owner: joel deleted
Version: 56
Note: See TracTickets for help on using tickets.