loader/efi/linux: Fix memory leak
PATCH v2 2/3 loader/efi/linux: Fix memory leak
From: khaalid <[email protected]>
Free "mempath" in case of failures.
Signed-off-by Khalid Ali <[email protected]>
--- grub-core/loader/efi/linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
grub-core/loader/efi/linux.c +7 -0
@@ -213,7 +213,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args) (void *) addr, size, &image_handle);if (status !=GRUB_EFI_SUCCESS ) + { +grub_free (mempath);return grub_error (GRUB_ERR_BAD_OS ,"cannot load image 0x%lx" , status); + }
@@ -232,7 +232,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (len));if (!loaded_image->load_options) + { +grub_free (mempath);return grub_errno; + }
@@ -248,7 +248,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)grub_efi_free_pages ((grub_addr_t ) loaded_image->load_options,GRUB_EFI_BYTES_TO_PAGES (len)); loaded_image->load_options =NULL ; +grub_free (mempath); unload: b->unload_image (image_handle);
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel