diff options
| author | longlong yan <yanlonglong@kylinos.cn> | 2026-09-02 10:39:13 +0800 |
|---|---|---|
| committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2026-09-03 09:00:35 +0900 |
| commit | 68097f9cdd526b81e7832556aaf76acd44dc357e (patch) | |
| tree | e1af455aeb90ee157f62858885470280bfbe3991 /scripts/Makefile.thinlto | |
| parent | 27e32b6f4303dd6c8cdb46b9e533b48342e83561 (diff) | |
| download | linux-next-68097f9cdd526b81e7832556aaf76acd44dc357e.tar.gz linux-next-68097f9cdd526b81e7832556aaf76acd44dc357e.zip | |
tools/firewire: nosy-dump: fix input file handle leak
The input file handle opened via the --input option is leaked on
multiple exit paths:
1. When fopen() for the output file fails, the already-opened input
handle is not closed before returning.
2. When fread() reaches EOF while reading from the input file, the
main loop returns directly, bypassing the cleanup section entirely.
3. On normal exit (e.g., SIGINT), the cleanup section closes output
and fd but never closes input.
Fix this by closing the input handle on the output-fopen error path
and in the cleanup section, and by changing the fread EOF early return
to a break so that the cleanup section runs.
Signed-off-by: longlong yan <yanlonglong@kylinos.cn>
Link: https://lore.kernel.org/r/20260902023914.959-1-yanlonglong@kylinos.cn
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
