commands/efi: Fix sevral memory leaks
cover commands/efi: Fix sevral memory leaks
"handles" that "grub_efi_locate_handles" was allocated with "grub_malloc" wasn't being freed.
--- grub-core/commands/efi/lsefi.c | 1 + grub-core/commands/efi/tpm.c | 2 ++ 2 files changed, 3 insertions(+)
grub-core/commands/efi/lsefi.c +1 -0
@@ -129,6 +129,7 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), } +grub_free (handles);return 0 ; }
grub-core/commands/efi/tpm.c +2 -0
@@ -112,6 +112,7 @@ grub_tpm_handle_find (grub_efi_handle_t *tpm_handle, grub_tpm_version =1 ; *protocol_version =1 ;grub_dprintf ("tpm" ,"TPM handle Found, version: 1\n" ); +grub_free (handles);return 1 ; }
@@ -124,6 +125,7 @@ grub_tpm_handle_find (grub_efi_handle_t *tpm_handle, grub_tpm_version =2 ; *protocol_version =2 ;grub_dprintf ("tpm" ,"TPM handle Found, version: 2\n" ); +grub_free (handles);return 1 ; }
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
From: Khalid Ali <[email protected]>
I added Daniel review tag, as he requested from me by privious thread. He reviewed this patch from another thread.
Best regards,
khaalid
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 1 line · khaalid cali
"handles" that "
grub_efi_locate_handles" was allocated with "grub_malloc" wasn't being freed.
The "handles" allocated by grub_efi_locate_handle() call are not always freed. Add missing grub_free() calls.
Quoted 5 lines
Signed-off-by Khalid Ali <[email protected]>Reviewed-by Daniel Kiper <[email protected]>--- grub-core/commands/efi/lsefi.c | 1 + grub-core/commands/efi/tpm.c | 2 ++
This patch is not complete. At least one grub_free() call is missing in grub-core/video/efi_gop.c:check_protocol().
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel