Skip to content

fix: close config file after reading - #367

Merged
tksm merged 1 commit into
stern:masterfrom
Spuxy:resource_leak_cmd
May 3, 2026
Merged

tksm merged 1 commit into
stern:masterfrom
Spuxy:resource_leak_cmd

Conversation

@Spuxy

@Spuxy Spuxy commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The config file opened in readConfigFromFile was never closed, leaking the file handle until process exit.
  • Added defer configFile.Close() immediately after the successful os.Open.

Simple testing

  • go build ./...
  • make build

@tksm tksm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix!

@tksm
tksm merged commit ee5b0b3 into stern:master May 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants