loader/efi/linux: Reset freed pointer

Avoid dangling pointer. Code should not be reached but better safe than sorry.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Frediano Ziglio authored and Daniel Kiper committed 2024-09-05 19:12:08 +02:00
1 parent 92bed41bf8
commit 9c34d56c2d
1 file changed
+1
+1
View File
@@ -241,6 +241,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
grub_error (GRUB_ERR_BAD_OS, "start_image() returned 0x%" PRIxGRUB_EFI_UINTN_T, status); grub_error (GRUB_ERR_BAD_OS, "start_image() returned 0x%" PRIxGRUB_EFI_UINTN_T, status);
grub_efi_free_pages ((grub_addr_t) loaded_image->load_options, grub_efi_free_pages ((grub_addr_t) loaded_image->load_options,
GRUB_EFI_BYTES_TO_PAGES (len)); GRUB_EFI_BYTES_TO_PAGES (len));
loaded_image->load_options = NULL;
unload: unload:
b->unload_image (image_handle); b->unload_image (image_handle);