Fix memory leaks in ofnet.
Reported by: Francesco Lavra.
This commit is contained in:
parent
9d21381bac
commit
fe22b071dc
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-04-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Fix memory leaks in ofnet.
|
||||||
|
Reported by: Francesco Lavra.
|
||||||
|
|
||||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* docs/man/grub-glue-efi.h2m: Add missing file.
|
* docs/man/grub-glue-efi.h2m: Add missing file.
|
||||||
|
|
|
@ -97,10 +97,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);
|
||||||
|
@ -281,6 +278,9 @@ search_net_devices (struct grub_ieee1275_devalias *alias)
|
||||||
card->txbuf = grub_zalloc (card->txbufsize);
|
card->txbuf = grub_zalloc (card->txbufsize);
|
||||||
if (!card->txbuf)
|
if (!card->txbuf)
|
||||||
{
|
{
|
||||||
|
grub_free (ofdata->path);
|
||||||
|
grub_free (ofdata);
|
||||||
|
grub_free (card);
|
||||||
grub_print_error ();
|
grub_print_error ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue