mirror of
https://github.com/safing/portmaster
synced 2025-04-16 17:09:09 +00:00
fix: close file
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
parent
0f808f568b
commit
43043bc5e6
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,10 @@ func (p *Process) GetExecHash(algorithm string) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
_ = file.Close()
|
||||||
|
}()
|
||||||
|
|
||||||
_, err = io.Copy(hasher, file)
|
_, err = io.Copy(hasher, file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
Loading…
Add table
Reference in a new issue