diff --git a/pkg/hostman/guestfs/fsdriver/linux.go b/pkg/hostman/guestfs/fsdriver/linux.go index 03e23be4d7..d4ebb4387e 100644 --- a/pkg/hostman/guestfs/fsdriver/linux.go +++ b/pkg/hostman/guestfs/fsdriver/linux.go @@ -518,6 +518,7 @@ func (l *sLinuxRootFs) GetArch(rootFs IDiskPartition) string { log.Errorf("failed read file elf %s: %s", rp, err) continue } + defer elfHeader.Close() // https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header switch elfHeader.Machine { case elf.EM_X86_64: