cpukit/fdt: Free index before container

Ensure that the index is released before the structure containing it is
freed and NULLed.

Updates #4460
This commit is contained in:
Kinsey Moore
2022-09-20 10:30:12 -05:00
committed by Joel Sherrill
parent 584f5bc9af
commit 3af84c1bea

View File

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