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-10-03 13:24:46 -05:00
committed by Joel Sherrill
parent c6bd860f13
commit 584f5bc9af
+1 -1
View File
@@ -182,7 +182,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;