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 cab00c7035
commit 05461aa475

View File

@@ -680,14 +680,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;
}