Skip to contentSkip to conversation

commands/efi/tmp: Fix memory leak

PATCH RESEND In review khaalid cali 2 participants 2 messages May 16, 2025 – May 19, 2025

v1 of 2 In review Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 3/3 commands/efi/tmp: Fix memory leak

From: khaalid <[email protected]>

Free handles probably before return.

---
 grub-core/commands/efi/tpm.c | 2 ++
 1 file changed, 2 insertions(+)
grub-core/commands/efi/tpm.c +2 -0
index cbac69866..cb39b7bba 100644
@@ -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