All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] lsefi: fixed memory leaks
@ 2025-06-10  9:52 Renaud Métrich via Grub-devel
  2025-06-10 17:47 ` sudhakar
  2025-06-18 15:00 ` Daniel Kiper
  0 siblings, 2 replies; 3+ messages in thread
From: Renaud Métrich via Grub-devel @ 2025-06-10  9:52 UTC (permalink / raw)
  To: grub-devel; +Cc: Renaud Métrich, dkiper

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
---
 grub-core/commands/efi/lsefi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c
index 7b8316d41..a70f243d0 100644
--- a/grub-core/commands/efi/lsefi.c
+++ b/grub-core/commands/efi/lsefi.c
@@ -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;
 }
 
-- 
2.49.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] lsefi: fixed memory leaks
  2025-06-10  9:52 [PATCH v1] lsefi: fixed memory leaks Renaud Métrich via Grub-devel
@ 2025-06-10 17:47 ` sudhakar
  2025-06-18 15:00 ` Daniel Kiper
  1 sibling, 0 replies; 3+ messages in thread
From: sudhakar @ 2025-06-10 17:47 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Renaud Métrich, dkiper

On 2025-06-10 15:22, Renaud Métrich via Grub-devel wrote:
> Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
> ---
>  grub-core/commands/efi/lsefi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/grub-core/commands/efi/lsefi.c 
> b/grub-core/commands/efi/lsefi.c
> index 7b8316d41..a70f243d0 100644
> --- a/grub-core/commands/efi/lsefi.c
> +++ b/grub-core/commands/efi/lsefi.c
> @@ -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);

Hi Renaud Métrich,

better to use like this

      if (protocols != NULL)
        grub_efi_free_pool (protocols);

thanks,
Sudhakar

>      }
> 
> +  grub_free (handles);
> +
>    return 0;
>  }

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] lsefi: fixed memory leaks
  2025-06-10  9:52 [PATCH v1] lsefi: fixed memory leaks Renaud Métrich via Grub-devel
  2025-06-10 17:47 ` sudhakar
@ 2025-06-18 15:00 ` Daniel Kiper
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2025-06-18 15:00 UTC (permalink / raw)
  To: Renaud Métrich; +Cc: grub-devel

On Tue, Jun 10, 2025 at 11:52:39AM +0200, Renaud Métrich via Grub-devel wrote:
> Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
> ---
>  grub-core/commands/efi/lsefi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c
> index 7b8316d41..a70f243d0 100644
> --- a/grub-core/commands/efi/lsefi.c
> +++ b/grub-core/commands/efi/lsefi.c
> @@ -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);

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
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-18 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10  9:52 [PATCH v1] lsefi: fixed memory leaks Renaud Métrich via Grub-devel
2025-06-10 17:47 ` sudhakar
2025-06-18 15:00 ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.