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:
Kinsey Moore
2022-09-20 10:24:59 -05:00
committed by Joel Sherrill
parent c5b794227b
commit cab00c7035

View File

@@ -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;