[PATCH 2/5] rtems-fdt.c: Fix Resource leak (CID #1437645)

Ryan Long ryan.long at oarcorp.com
Fri Mar 12 15:18:43 UTC 2021


CID 1437645: Resource leak in rtems_fdt_load().

Closes #4297
---
 cpukit/libmisc/rtems-fdt/rtems-fdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
index 0ea3653..5bb7ce0 100644
--- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
+++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
@@ -611,6 +611,7 @@ rtems_fdt_load (const char* filename, rtems_fdt_handle* handle)
     return fe;
   }
 
+  close (bf);
   return 0;
 }
 
-- 
1.8.3.1



More information about the devel mailing list