Anton Moryakov a4fb99ce4e tools: fix handle leak in ifdtool.c
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>
2025-06-03 17:18:02 -06:00
..
2025-05-27 10:07:41 +01:00
2025-05-27 10:07:41 +01:00
2024-10-21 20:51:23 -06:00
2024-07-15 12:12:18 -06:00
2024-09-12 17:35:37 +02:00
2024-07-15 12:12:18 -06:00
2024-07-15 12:12:18 -06:00
2025-06-03 17:18:02 -06:00
2023-01-27 12:51:26 -05:00
2024-07-15 12:12:18 -06:00
2024-07-15 12:12:18 -06:00
2025-04-28 13:25:59 -06:00
2024-07-15 12:12:18 -06:00
2025-01-26 11:35:46 -06:00
2025-04-11 12:16:44 -06:00