efiemu: fix memory leak

Found by: Coverity scan.
CID: 156610
This commit is contained in:
Andrei Borzenkov 2016-01-12 21:25:40 +03:00
parent e9d71db53a
commit dbb0f9fa4f

View file

@ -154,7 +154,10 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e)
s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE
: GRUB_EFI_RUNTIME_SERVICES_DATA);
if (seg->handle < 0)
{
grub_free (seg);
return grub_errno;
}
seg->off = 0;
}