Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Unhandled errors when closing files #635

Closed
tomtau opened this issue Oct 7, 2021 · 0 comments · Fixed by #679
Closed

Unhandled errors when closing files #635

tomtau opened this issue Oct 7, 2021 · 0 comments · Fixed by #679
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tomtau
Copy link
Contributor

tomtau commented Oct 7, 2021

KS-THA-F-14

in ethereum/rpc/namespaces/debug/trace.go , ethereum/rpc/namespaces/debug/internal.go , ethereum/rpc/namespaces/debug/utils.go , ethereum/rpc/websockets.go

Errors returned when closing files are not properly handled. This can cause panics. Moreover, deferring unsafe method "Close" on type "*os.File" can create panic.
We recommend always handling errors when closing files and not deferring closure. See also https://www.joeshaw.org/dont-defer-close-on-writable-files/ .

@tomtau tomtau added good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed labels Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant