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

Commit

Permalink
fix: handle file close logic (#679)
Browse files Browse the repository at this point in the history
* handle file close logic

* Update rpc/ethereum/namespaces/debug/utils.go

* update changelog

Co-authored-by: Federico Kunze Küllmer <[email protected]>
  • Loading branch information
JayT106 and fedekunze committed Oct 22, 2021
1 parent ea803b7 commit d7d5141
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm) [tharsis#650](https://github.com/tharsis/ethermint/pull/650) Fix panic when flattening the cache context in case transaction is reverted.
* (rpc, test) [tharsis#608](https://github.com/tharsis/ethermint/pull/608) Fix rpc test.

### Improvements

(rpc) [tharsis#679](https://github.com/tharsis/ethermint/pull/679) Fix file close handle.

## [v0.7.0] - 2021-10-07

### API Breaking
Expand Down
8 changes: 6 additions & 2 deletions rpc/ethereum/namespaces/debug/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ func writeProfile(name, file string, log log.Logger) error {
if err != nil {
return err
}
defer f.Close()

return p.WriteTo(f, 0)
if err := p.WriteTo(f, 0); err != nil {
f.Close()
return err
}

return f.Close()
}

0 comments on commit d7d5141

Please sign in to comment.