Avnish Chouhan 5f0ffd7f57 term/ieee1275/serial: Fix memory leak
The grub_zalloc() allocates memory for port. 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 return.

Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2025-11-06 15:31:43 +01:00
..
2022-03-14 16:00:06 +01:00
2022-03-14 16:00:06 +01:00
2025-11-06 15:31:43 +01:00