Skip to content

Commit a5e3d74

Browse files
authored
Merge pull request kubernetes#79534 from odinuge/volume-util-fd
Fix possible fd leak and closing of dirs in doSafeMakeDir
2 parents 64a2be8 + 626a0f7 commit a5e3d74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/volume/util/subpath/subpath_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ func doSafeMakeDir(pathname string, base string, perm os.FileMode) error {
398398
return fmt.Errorf("cannot create directory %s: %s", currentPath, err)
399399
}
400400
// Dive into the created directory
401-
childFD, err := syscall.Openat(parentFD, dir, nofollowFlags, 0)
401+
childFD, err = syscall.Openat(parentFD, dir, nofollowFlags, 0)
402402
if err != nil {
403403
return fmt.Errorf("cannot open %s: %s", currentPath, err)
404404
}

0 commit comments

Comments
 (0)