Describe the bug
In fetcher/fetcher.go:1045-1046, the debug log file is opened and closed inline without defer:
_, _ = f.WriteString(msg)
_ = f.Close()
If a panic occurs between open and close (or if WriteString panics), the file descriptor leaks.
To reproduce
- Enable DEBUG_IMAP
- Trigger a panic during IMAP logging
- File descriptor leaked
Expected behavior
Use defer f.Close() immediately after opening the file.
Describe the bug
In fetcher/fetcher.go:1045-1046, the debug log file is opened and closed inline without
defer:If a panic occurs between open and close (or if WriteString panics), the file descriptor leaks.
To reproduce
Expected behavior
Use
defer f.Close()immediately after opening the file.