commands/efi/lsefi: Fix memory leak
cover commands/efi/lsefi: Fix memory leak
From: khaalid <[email protected]>
It was forgotten to free handles array of handles returned bygrub_efi_locate_handle. This is quite a large amount of memory, it depends how many handles being returned which can be hundrends.
--- grub-core/commands/efi/lsefi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/commands/efi/lsefi.c +1 -1
@@ -128,7 +128,7 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), } } - +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 1 line · khaalid cali
From: khaalid <[email protected]>
You can drop this if it is your patch.
Quoted 1 line
It was forgotten to free
handlesarray of handles returned by
Please use " instead of ` and/or '.
Quoted 1 line
grub_efi_locate_handle. This is quite a large amount of memory, it depends how many handles being returned which can be hundrends.
Please wrap lines more or less at 80 characters.
Quoted 10 lines
Signed-off-by Khalid Ali <[email protected]>--- grub-core/commands/efi/lsefi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)grub-core/commands/efi/lsefi.c +0
-0
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 +1
-1@@ -128,7 +128,7 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), } } - +grub_free (handles);
Good catch!
Could you fix indention and add space before "("? [1]
Additionally, I can see similar issues around grub_efi_locate_handle() calls in other places too, e.g., grub-core/commands/efi/tpm.c. Could you fix that too? You can do that in the same patch.
grub-core/commands/efi/lsefi.c grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), · line 133
Quoted 2 lines
grub-core/commands/efi/lsefi.c +0
-0return 0 ; }
Daniel
[1] https://www.gnu.org/software/grub/manual/grub-dev/grub-dev.html#Coding-style
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel