]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
tcpip_input()/tcpip_ethinput(): don't free the pbuf if returning ERR_MEM, that is...
authorgoldsimon <goldsimon>
Thu, 17 May 2007 09:04:36 +0000 (09:04 +0000)
committergoldsimon <goldsimon>
Thu, 17 May 2007 09:04:36 +0000 (09:04 +0000)
src/api/tcpip.c

index 430e85e620b4140d8043d5f7cf57e9c137bee01c..94f82dd984c01af8c70127246a9343d3f00fee1a 100644 (file)
@@ -150,10 +150,10 @@ ethernet_input(struct pbuf *p, struct netif *netif)
   switch (htons(ethhdr->type)) {
     /* IP packet? */
     case ETHTYPE_IP:
-      #if ETHARP_TRUST_IP_MAC
+#if ETHARP_TRUST_IP_MAC
       /* update ARP table */
       etharp_ip_input( netif, p);
-      #endif
+#endif
       /* skip Ethernet header */
       if(pbuf_header(p, -(s16_t)sizeof(struct eth_hdr))) {
         LWIP_ASSERT("Can't move over header in packet", 0);
@@ -255,7 +255,6 @@ tcpip_input(struct pbuf *p, struct netif *inp)
   if (mbox != SYS_MBOX_NULL) {
     msg = memp_malloc(MEMP_TCPIP_MSG);
     if (msg == NULL) {
-      pbuf_free(p);
       return ERR_MEM;
     }
 
@@ -278,8 +277,7 @@ tcpip_ethinput(struct pbuf *p, struct netif *inp)
   if (mbox != SYS_MBOX_NULL) {
     msg = memp_malloc(MEMP_TCPIP_MSG);
     if (msg == NULL) {
-      pbuf_free(p);    
-      return ERR_MEM;  
+      return ERR_MEM;
     }
     
     msg->type = TCPIP_MSG_ETHINPUT;