]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
loader/efi/linux: Reset freed pointer
authorFrediano Ziglio <frediano.ziglio@cloud.com>
Tue, 3 Sep 2024 15:15:47 +0000 (16:15 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 5 Sep 2024 17:12:08 +0000 (19:12 +0200)
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>
grub-core/loader/efi/linux.c

index 64ff984f57e91408d677d89660cba88894f5e5a5..78ea07ca8018167de6aa148c54c8c3488fed8bdb 100644 (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_efi_free_pages ((grub_addr_t) loaded_image->load_options,
                       GRUB_EFI_BYTES_TO_PAGES (len));
+  loaded_image->load_options = NULL;
 unload:
   b->unload_image (image_handle);