diff options
author | Kinsey Moore <kinsey.moore@oarcorp.com> | 2022-09-20 10:24:59 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2022-10-03 13:24:28 -0500 |
commit | cab00c703525648cb8cd77c0b29aaf80d3f56276 (patch) | |
tree | cb625d074015d73a8ad1cb5e7a985fabca9bb545 | |
parent | cpukit/include: Fix including in C++ (diff) | |
download | rtems-cab00c703525648cb8cd77c0b29aaf80d3f56276.tar.bz2 |
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
-rw-r--r-- | cpukit/libmisc/rtems-fdt/rtems-fdt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c index b96ccbc1b0..122407f630 100644 --- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c +++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c @@ -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; |