Skip to content

Commit

Permalink
fix(contribs): close file in execBalancesExport (#3294)
Browse files Browse the repository at this point in the history
Ensures that the opened file is not leaked and
closed after use.

Fixes #3032
  • Loading branch information
odeke-em authored Dec 7, 2024
1 parent 5f7216d commit 79c9b04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contribs/gnogenesis/internal/balances/balances_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func execBalancesExport(cfg *balancesCfg, io commands.IO, args []string) error {
if err != nil {
return fmt.Errorf("unable to create output file, %w", err)
}
defer outputFile.Close()

// Save the balances
for _, balance := range state.Balances {
Expand Down

0 comments on commit 79c9b04

Please sign in to comment.