mirror of
https://git.proxmox.com/git/grub2
synced 2025-08-09 08:45:38 +00:00
efi/serial: fix memory leak
Found by: Coverity scan. CID: 96678
This commit is contained in:
parent
47490ada3d
commit
e7e05cae8d
@ -173,7 +173,10 @@ grub_efiserial_init (void)
|
|||||||
|
|
||||||
port->name = grub_malloc (sizeof ("efiXXXXXXXXXXXXXXXXXXXX"));
|
port->name = grub_malloc (sizeof ("efiXXXXXXXXXXXXXXXXXXXX"));
|
||||||
if (!port->name)
|
if (!port->name)
|
||||||
|
{
|
||||||
|
grub_free (port);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
grub_snprintf (port->name, sizeof ("efiXXXXXXXXXXXXXXXXXXXX"),
|
grub_snprintf (port->name, sizeof ("efiXXXXXXXXXXXXXXXXXXXX"),
|
||||||
"efi%d", num_serial++);
|
"efi%d", num_serial++);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user