forked from Imagelibrary/rtems
cpukit/fdt: Check correct allocation
The second allocation check was mistakenly rechecking the first allocation. It now checks the correct allocation and ensures that names is not NULL. Updates #4462
This commit is contained in:
committed by
Joel Sherrill
parent
c5b794227b
commit
cab00c7035
@@ -163,7 +163,7 @@ rtems_fdt_init_index (rtems_fdt_handle* fdt, rtems_fdt_blob* blob)
|
||||
}
|
||||
|
||||
names = calloc(1, total_name_memory);
|
||||
if (!entries)
|
||||
if (!names)
|
||||
{
|
||||
free(entries);
|
||||
return -RTEMS_FDT_ERR_NO_MEMORY;
|
||||
|
||||
Reference in New Issue
Block a user