[PATCH] tools: fix handle leak in ifdtool.c

Tom Rini trini at konsulko.com
Wed Jun 4 01:19:12 CEST 2025


On Fri, 16 May 2025 18:25:38 +0300, ant.v.moryakov at gmail.com wrote:

> Prevent file descriptor leaks by properly closing 'fd' and 'new_fd'
> when fstat() or write() operations fail.
> 
> - Added close(fd) before return in open_for_read() if fstat() fails.
> - Added close(new_fd) before return in write_image() if write() fails.
> - No close needed if open() fails (fd == -1 is invalid).
> 
> [...]

Applied to u-boot/next, thanks!

[1/1] tools: fix handle leak in ifdtool.c
      commit: a4fb99ce4e6ee62f3278d7472b9b9282d7b289ed
-- 
Tom




More information about the U-Boot mailing list