mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
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). Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
28 KiB
28 KiB