mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-12 14:48:13 +00:00
vc: Persist file handle may leak in FS#ToDisk
Fixes #2241 Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
a17ca14c7a
commit
b8b6733f62
@ -139,10 +139,10 @@ func (fs *FS) ToDisk(ss persistapi.SandboxState, cs map[string]persistapi.Contai
|
||||
return err
|
||||
}
|
||||
|
||||
defer cf.Close()
|
||||
if err := json.NewEncoder(cf).Encode(cstate); err != nil {
|
||||
return err
|
||||
}
|
||||
cf.Close()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user