lsefi: fixed memory leaks
PATCH 1/1 lsefi: fixed memory leaks
--- grub-core/commands/efi/lsefi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
grub-core/commands/efi/lsefi.c +5 -1
@@ -1,6 +1,6 @@/* * GRUB -- GRand Unified Bootloader -* Copyright (C) 2012 Free Software Foundation, Inc. +* Copyright (C) 2025 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -127,8 +127,12 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),grub_printf (" %pG\n" , protocols[j]); } +if (protocols) +grub_efi_free_pool (protocols); } +grub_free (handles); +return 0 ; }
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 19 lines · Renaud Métrich via Grub-devel
Signed-off-by Renaud Métrich <[email protected]>--- grub-core/commands/efi/lsefi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)grub-core/commands/efi/lsefi.c +1
-1@@ -1,6 +1,6 @@/* * GRUB -- GRand Unified Bootloader -* Copyright (C) 2012 Free Software Foundation, Inc. +* Copyright (C) 2025 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
grub-core/commands/efi/lsefi.c grub_cmd_lsefi (grub_command_t cmd __attribute__ · line 132
Quoted 6 lines
grub-core/commands/efi/lsefi.c +2
-0@@ -127,8 +127,12 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),grub_printf (" %pG\n" , protocols[j]); } +if (protocols) +grub_efi_free_pool (protocols);
Hi Renaud Métrich,
better to use like this
if (protocols != NULL)
grub_efi_free_pool (protocols);thanks,
Sudhakar
grub-core/commands/efi/lsefi.c grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), · line 137
Quoted 6 lines
grub-core/commands/efi/lsefi.c +2
-0} +grub_free (handles); +return 0 ; }
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 18 lines · Renaud Métrich via Grub-devel
Signed-off-by Renaud Métrich <[email protected]>--- grub-core/commands/efi/lsefi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)grub-core/commands/efi/lsefi.c +1
-1@@ -1,6 +1,6 @@/* * GRUB -- GRand Unified Bootloader -* Copyright (C) 2012 Free Software Foundation, Inc. +* Copyright (C) 2025 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
grub-core/commands/efi/lsefi.c grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), · line 131
Quoted 5 lines
grub-core/commands/efi/lsefi.c +2
-0@@ -127,8 +127,12 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),grub_printf (" %pG\n" , protocols[j]); } +if (protocols) +grub_efi_free_pool (protocols);
How many times have I to say this function does not exist in GRUB upstream? This shows you even did not build the GRUB with this change before sending the email...
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel