From: Andrei Borzenkov Date: Tue, 12 Jan 2016 18:25:40 +0000 (+0300) Subject: efiemu: fix memory leak X-Git-Tag: 2.02-beta3~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbb0f9fa4fe7a9c3721178edf2421825dce5ad07;p=thirdparty%2Fgrub.git efiemu: fix memory leak Found by: Coverity scan. CID: 156610 --- diff --git a/grub-core/efiemu/loadcore.c b/grub-core/efiemu/loadcore.c index e68e7e4d1..44085ef81 100644 --- a/grub-core/efiemu/loadcore.c +++ b/grub-core/efiemu/loadcore.c @@ -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) - return grub_errno; + { + grub_free (seg); + return grub_errno; + } seg->off = 0; }