Skip to content

Commit

Permalink
Fix File to Close
Browse files Browse the repository at this point in the history
(This is a cherry-pick of 937ca10.)

Signed-off-by: hang.jiang <[email protected]>
Fixes: GHSA-xr7r-f8xq-vfvv CVE-2024-21626
Signed-off-by: Aleksa Sarai <[email protected]>
  • Loading branch information
hang.jiang authored and cyphar committed Jan 23, 2024
1 parent 099ff69 commit 506552a
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 @@ -174,6 +174,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 506552a

Please sign in to comment.