efiemu: fix memory leak
Found by: Coverity scan. CID: 156610
This commit is contained in:
parent
e9d71db53a
commit
dbb0f9fa4f
1 changed files with 4 additions and 1 deletions
|
@ -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
|
s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE
|
||||||
: GRUB_EFI_RUNTIME_SERVICES_DATA);
|
: GRUB_EFI_RUNTIME_SERVICES_DATA);
|
||||||
if (seg->handle < 0)
|
if (seg->handle < 0)
|
||||||
return grub_errno;
|
{
|
||||||
|
grub_free (seg);
|
||||||
|
return grub_errno;
|
||||||
|
}
|
||||||
seg->off = 0;
|
seg->off = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue