Re: [PATCH] Fixing a memory leak in serial.c

Daniel Kiper <[email protected]>
Newsgroups org.gnu.grub-devel
Message-ID <[email protected]>
On Tue, Oct 28, 2025 at 09:58:51PM +0530, Avnish Chouhan wrote:
> grub_zalloc() allocates memory for port. And if the allocation for
> port->name fails, the function returns NULL without freeing the
> previously allocated port memory. This results in a memory leak. To
> avoid this, we must free port before returning.
>
> Signed-off-by: Avnish Chouhan <[email protected]>

Reviewed-by: Daniel Kiper <[email protected]>

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.