Skip to content

Commit

Permalink
Fix File to Close
Browse files Browse the repository at this point in the history
Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
  • Loading branch information
hang.jiang committed Sep 1, 2023
1 parent 24ae5c2 commit 937ca10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions libcontainer/cgroups/fs/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func tryDefaultCgroupRoot() string {
if err != nil {
return ""
}
defer dir.Close()
names, err := dir.Readdirnames(1)
if err != nil {
return ""
Expand Down
1 change: 1 addition & 0 deletions update.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ other options are ignored.
if err != nil {
return err
}
defer f.Close()
}
err = json.NewDecoder(f).Decode(&r)
if err != nil {
Expand Down

0 comments on commit 937ca10

Please sign in to comment.