From 8dfcf07c241405136f752666cfb80927c7999579 Mon Sep 17 00:00:00 2001 From: OnlyShirley Date: Thu, 27 Apr 2023 07:13:11 +0800 Subject: [PATCH] [HUST CSE]Assign Null to fdt after free to avoid dangling pointer (#7389) --- components/drivers/fdt/src/dtb_load.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/drivers/fdt/src/dtb_load.c b/components/drivers/fdt/src/dtb_load.c index e3b7f34e8b..f1532f5c08 100644 --- a/components/drivers/fdt/src/dtb_load.c +++ b/components/drivers/fdt/src/dtb_load.c @@ -52,6 +52,7 @@ void *dtb_node_load_from_fs(char *dtb_filename) if (dtb_node_check(fdt) == RT_FALSE) { free(fdt); + fdt=NULL; } }