]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
efiemu: fix memory leak
authorAndrei Borzenkov <arvidjaar@gmail.com>
Tue, 12 Jan 2016 18:25:40 +0000 (21:25 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Tue, 12 Jan 2016 18:52:50 +0000 (21:52 +0300)
Found by: Coverity scan.
CID: 156610

grub-core/efiemu/loadcore.c

index e68e7e4d1606b120a2d2ea3ab4760b1f7af59d2f..44085ef818ec28fca0ef407da936745cac61d83e 100644 (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)
-               return grub_errno;
+               {
+                 grub_free (seg);
+                 return grub_errno;
+               }
              seg->off = 0;
            }