summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2022-09-20 10:30:12 -0500
committerJoel Sherrill <joel@rtems.org>2022-10-03 13:24:46 -0500
commit3af84c1beabd129c08d5d1bfcb553c79ad59d462 (patch)
tree88142e7740e551c1900735d2254959f9a7ea7660
parentcpukit/fdt: Check correct allocation (diff)
downloadrtems-3af84c1beabd129c08d5d1bfcb553c79ad59d462.tar.bz2
cpukit/fdt: Free index before container
Ensure that the index is released before the structure containing it is freed and NULLed. Updates #4460
Diffstat (limited to '')
-rw-r--r--cpukit/libmisc/rtems-fdt/rtems-fdt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
index 1d3b82ae29..bea01dbf78 100644
--- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
+++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
@@ -700,14 +700,14 @@ rtems_fdt_unload (rtems_fdt_handle* handle)
rtems_chain_extract_unprotected (&handle->blob->node);
+ rtems_fdt_release_index(&handle->blob->index);
+
free (handle->blob);
handle->blob = NULL;
rtems_fdt_unlock (fdt);
- rtems_fdt_release_index(&handle->blob->index);
-
return 0;
}