]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix a memory leak
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Jun 2011 02:18:45 +0000 (04:18 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Jun 2011 02:18:45 +0000 (04:18 +0200)
grub-core/net/ethernet.c

index 863e659a8afd2f6942a472072dae99090c27b1fb..175d0b65f78d4a73e26d636f0b2c776923b112ba 100644 (file)
@@ -69,10 +69,14 @@ grub_net_recv_ethernet_packet (struct grub_net_buff * nb,
     {
       grub_net_arp_receive (nb);
       grub_netbuff_free (nb);
+      return GRUB_ERR_NONE;
     }
   /* IP packet.  */
   if (type == GRUB_NET_ETHERTYPE_IP)
-    grub_net_recv_ip_packets (nb, card, &hwaddress);
-
+    {
+      grub_net_recv_ip_packets (nb, card, &hwaddress);
+      return GRUB_ERR_NONE;
+    }
+  grub_netbuff_free (nb);
   return GRUB_ERR_NONE;
 }