Skip to content

Commit

Permalink
Merge pull request #79534 from odinuge/volume-util-fd
Browse files Browse the repository at this point in the history
Fix possible fd leak and closing of dirs in doSafeMakeDir
  • Loading branch information
k8s-ci-robot committed Jul 1, 2019
2 parents 64a2be8 + 626a0f7 commit a5e3d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/volume/util/subpath/subpath_linux.go
Expand Up @@ -398,7 +398,7 @@ func doSafeMakeDir(pathname string, base string, perm os.FileMode) error {
return fmt.Errorf("cannot create directory %s: %s", currentPath, err)
}
// Dive into the created directory
childFD, err := syscall.Openat(parentFD, dir, nofollowFlags, 0)
childFD, err = syscall.Openat(parentFD, dir, nofollowFlags, 0)
if err != nil {
return fmt.Errorf("cannot open %s: %s", currentPath, err)
}
Expand Down

0 comments on commit a5e3d74

Please sign in to comment.