fix(host-deployer): elfherader fd leak (#19475)

This commit is contained in:
wanyaoqi
2024-02-08 14:11:24 +08:00
committed by GitHub
parent 52404a26d9
commit 38834f3b1f
+1
View File
@@ -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: