mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 15:02:45 +00:00
vc: Persist file handle may leak in FS#FromDisk
Fixes #2233 Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
1f71114291
commit
2331e879af
@ -201,11 +201,11 @@ func (fs *FS) FromDisk(sid string) (persistapi.SandboxState, map[string]persista
|
||||
return ss, nil, err
|
||||
}
|
||||
|
||||
defer cf.Close()
|
||||
var cstate persistapi.ContainerState
|
||||
if err := json.NewDecoder(cf).Decode(&cstate); err != nil {
|
||||
return ss, nil, err
|
||||
}
|
||||
cf.Close()
|
||||
|
||||
fs.containerState[cid] = cstate
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user