diff options
| author | Anton Moryakov <[email protected]> | 2025-05-16 18:25:38 +0300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-06-03 17:18:02 -0600 |
| commit | a4fb99ce4e6ee62f3278d7472b9b9282d7b289ed (patch) | |
| tree | 5c2a448adb9d3fa3e3a26fcfee9ef521950c5609 /include | |
| parent | d786c6b69f537ed2a64950028d270d064970d29f (diff) | |
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 <[email protected]>
Reviewed-by: Quentin Schulz <[email protected]>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
