[HUST CSE]Assign Null to fdt after free to avoid dangling pointer (#7389)

This commit is contained in:
OnlyShirley 2023-04-27 07:13:11 +08:00 committed by GitHub
parent 4b2a44f39e
commit 8dfcf07c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -52,6 +52,7 @@ void *dtb_node_load_from_fs(char *dtb_filename)
if (dtb_node_check(fdt) == RT_FALSE)
{
free(fdt);
fdt=NULL;
}
}