fix: close file

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guoguangwu 2024-04-26 18:08:15 +08:00
parent 0f808f568b
commit 43043bc5e6

View file

@ -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