Opened on 06/28/21 at 23:48:06
Closed on 10/31/22 at 15:02:09
#4462 closed defect (fixed)
CID 1437638: Logically dead code
Reported by: | Harrison Gerber | Owned by: | Gedare Bloom |
---|---|---|---|
Priority: | normal | Milestone: | 6.1 |
Component: | admin | Version: | 6 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
In rtems-fdt.c:
The indicated dead code may have performed some action; that action will never occur.
In rtems_fdt_init_index: Code can never be reached because of a logical contradiction (CWE-561)
159 entries = calloc(num_entries, sizeof(rtems_fdt_index_entry)); cond_notnull: Condition entries, taking true branch. Now the value of entries is not NULL. 160 if (!entries) 161 { 162 return -RTEMS_FDT_ERR_NO_MEMORY; 163 } 164 165 names = calloc(1, total_name_memory); notnull: At condition entries, the value of entries cannot be NULL. dead_error_condition: The condition !entries cannot be true. 166 if (!entries) 167 { CID 1437638 (#1 of 1): Logically dead code (DEADCODE) dead_error_begin: Execution cannot reach this statement: free(entries);. 168 free(entries); 169 return -RTEMS_FDT_ERR_NO_MEMORY; 170 }
Change History (4)
comment:1 Changed on 06/29/21 at 00:31:27 by Joel Sherrill
comment:4 Changed on 10/31/22 at 15:02:09 by Gedare Bloom
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
Shouldn't it be freeing the first variable allocated -- names?