efi/serial: fix memory leak
Found by: Coverity scan. CID: 96678
This commit is contained in:
parent
47490ada3d
commit
e7e05cae8d
1 changed files with 4 additions and 1 deletions
|
@ -173,7 +173,10 @@ grub_efiserial_init (void)
|
|||
|
||||
port->name = grub_malloc (sizeof ("efiXXXXXXXXXXXXXXXXXXXX"));
|
||||
if (!port->name)
|
||||
{
|
||||
grub_free (port);
|
||||
return;
|
||||
}
|
||||
grub_snprintf (port->name, sizeof ("efiXXXXXXXXXXXXXXXXXXXX"),
|
||||
"efi%d", num_serial++);
|
||||
|
||||
|
|
Loading…
Reference in a new issue