Skip to content

Commit 50c0d73

Browse files
committed
libct: add a defer fd close in createDeviceNode
Signed-off-by: lifubang <[email protected]> (cherry picked from commit 9a5e626) Signed-off-by: lifubang <[email protected]>
1 parent 52693ab commit 50c0d73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcontainer/rootfs_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,8 @@ func createDeviceNode(rootfs string, node *devices.Device, bind bool) error {
995995
if err != nil {
996996
return fmt.Errorf("mkdir parent of device inode %q: %w", node.Path, err)
997997
}
998+
defer destDir.Close()
999+
9981000
if bind {
9991001
return bindMountDeviceNode(destDir, destName, node)
10001002
}

0 commit comments

Comments
 (0)