Skip to content

Commit

Permalink
Merge pull request #1521 from testwill/close_file
Browse files Browse the repository at this point in the history
fix: close file
  • Loading branch information
dhaavi authored May 28, 2024
2 parents 21addd4 + 43043bc commit 1381556
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions service/process/executable.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func (p *Process) GetExecHash(algorithm string) (string, error) {
return "", err
}

defer func() {
_ = file.Close()
}()

_, err = io.Copy(hasher, file)
if err != nil {
return "", err
Expand Down

0 comments on commit 1381556

Please sign in to comment.