Skip to content

Commit

Permalink
Adding a file.Close() into the error catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Emma Turetsky committed Feb 24, 2025
1 parent 793cc84 commit a821114
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config/init_server_creds.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ func GenerateCert() error {
}
file, err := os.OpenFile(tlsCert, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0640)
if err != nil {
file.Close()
return err
}
defer file.Close()
Expand Down

0 comments on commit a821114

Please sign in to comment.