multiboot: fix memory leak
Found by: Coverity scan. CID: 96684
This commit is contained in:
parent
2a3ebf9428
commit
eb33e61b31
1 changed files with 4 additions and 1 deletions
|
@ -169,7 +169,10 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi
|
|||
return grub_errno;
|
||||
|
||||
if (grub_file_seek (file, ehdr->e_shoff) == (grub_off_t) -1)
|
||||
return grub_errno;
|
||||
{
|
||||
grub_free (shdr);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
if (grub_file_read (file, shdr, ehdr->e_shnum * ehdr->e_shentsize)
|
||||
!= (grub_ssize_t) ehdr->e_shnum * ehdr->e_shentsize)
|
||||
|
|
Loading…
Reference in a new issue