Skip to content

Commit 52192a8

Browse files
committed
libct: add a defer fd close in createDeviceNode
Signed-off-by: lifubang <lifubang@acmcoder.com> (cherry picked from commit 9a5e626) Signed-off-by: lifubang <lifubang@acmcoder.com>
1 parent 98dc593 commit 52192a8

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
@@ -998,6 +998,8 @@ func createDeviceNode(rootfs string, node *devices.Device, bind bool) error {
998998
if err != nil {
999999
return fmt.Errorf("mkdir parent of device inode %q: %w", node.Path, err)
10001000
}
1001+
defer destDir.Close()
1002+
10011003
if bind {
10021004
return bindMountDeviceNode(destDir, destName, node)
10031005
}

0 commit comments

Comments
 (0)