File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -588,6 +588,12 @@ func (m *mountEntry) createOpenMountpoint(rootfs string) (Err error) {
588588
589589func mountToRootfs (c * mountConfig , m mountEntry ) error {
590590 rootfs := c .root
591+ defer func () {
592+ if m .dstFile != nil {
593+ _ = m .dstFile .Close ()
594+ m .dstFile = nil
595+ }
596+ }()
591597
592598 // procfs and sysfs are special because we need to ensure they are actually
593599 // mounted on a specific path in a container without any funny business.
@@ -628,12 +634,6 @@ func mountToRootfs(c *mountConfig, m mountEntry) error {
628634 if err := m .createOpenMountpoint (rootfs ); err != nil {
629635 return fmt .Errorf ("create mountpoint for %s mount: %w" , m .Destination , err )
630636 }
631- defer func () {
632- if m .dstFile != nil {
633- _ = m .dstFile .Close ()
634- m .dstFile = nil
635- }
636- }()
637637
638638 switch m .Device {
639639 case "mqueue" :
You can’t perform that action at this time.
0 commit comments