Merge pull request #79534 from odinuge/volume-util-fd

Fix possible fd leak and closing of dirs in doSafeMakeDir
This commit is contained in:
Kubernetes Prow Robot 2019-07-01 15:09:58 -07:00 committed by GitHub
commit a5e3d74691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}