Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2242 from tedyu/to-disk-close
Browse files Browse the repository at this point in the history
vc: Persist file handle may leak in FS#ToDisk
  • Loading branch information
lifupan authored Nov 22, 2019
2 parents db696da + b8b6733 commit eae8449
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virtcontainers/persist/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eae8449

Please sign in to comment.