mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-03 01:52:03 +08:00
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
c6bd860f13
commit
584f5bc9af
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user