loader/efi/linux: Fix memory leak
PATCH 2/2 loader/efi/linux: Fix memory leak
Free mempath in case of failures.
Signed-off-by Khalid Ali <[email protected]>
--- grub-core/loader/efi/linux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
grub-core/loader/efi/linux.c +4 -1
@@ -212,7 +212,10 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args) (grub_efi_device_path_t *) mempath, (void *) addr, size, &image_handle);if (status !=GRUB_EFI_SUCCESS ) + { +grub_free (mempath);return grub_error (GRUB_ERR_BAD_OS ,"cannot load image" ); + }grub_dprintf ("linux" ,"linux command line: '%s'\n" , args);
@@ -244,7 +247,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args) loaded_image->load_options =NULL ; unload: b->unload_image (image_handle); - +grub_free (mempath);return grub_errno; }
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel