mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-31 07:19:06 +00:00
Merge pull request #2242 from tedyu/to-disk-close
vc: Persist file handle may leak in FS#ToDisk
This commit is contained in:
commit
eae8449231
@ -149,10 +149,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