Fix few memory leaks. Reported by Francesco Lavra
This commit is contained in:
parent
c86c39abef
commit
fa8058da9e
1 changed files with 3 additions and 4 deletions
|
@ -84,10 +84,7 @@ get_card_packet (struct grub_net_card *dev)
|
||||||
|
|
||||||
nb = grub_netbuff_alloc (dev->mtu + 64 + 2);
|
nb = grub_netbuff_alloc (dev->mtu + 64 + 2);
|
||||||
if (!nb)
|
if (!nb)
|
||||||
{
|
return NULL;
|
||||||
grub_netbuff_free (nb);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
/* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible
|
/* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible
|
||||||
by 4. So that IP header is aligned on 4 bytes. */
|
by 4. So that IP header is aligned on 4 bytes. */
|
||||||
grub_netbuff_reserve (nb, 2);
|
grub_netbuff_reserve (nb, 2);
|
||||||
|
@ -161,6 +158,8 @@ GRUB_MOD_INIT (ubootnet)
|
||||||
card->txbuf = grub_zalloc (card->txbufsize);
|
card->txbuf = grub_zalloc (card->txbufsize);
|
||||||
if (!card->txbuf)
|
if (!card->txbuf)
|
||||||
{
|
{
|
||||||
|
grub_free (ubdata);
|
||||||
|
grub_free (card);
|
||||||
grub_print_error ();
|
grub_print_error ();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue