Merge pull request #79534 from odinuge/volume-util-fd
Fix possible fd leak and closing of dirs in doSafeMakeDir
This commit is contained in:
commit
a5e3d74691
@ -398,7 +398,7 @@ func doSafeMakeDir(pathname string, base string, perm os.FileMode) error {
|
|||||||
return fmt.Errorf("cannot create directory %s: %s", currentPath, err)
|
return fmt.Errorf("cannot create directory %s: %s", currentPath, err)
|
||||||
}
|
}
|
||||||
// Dive into the created directory
|
// Dive into the created directory
|
||||||
childFD, err := syscall.Openat(parentFD, dir, nofollowFlags, 0)
|
childFD, err = syscall.Openat(parentFD, dir, nofollowFlags, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot open %s: %s", currentPath, err)
|
return fmt.Errorf("cannot open %s: %s", currentPath, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user