Free pbuf if pbuf_header() fails

This commit is contained in:
goldsimon 2007-03-26 19:27:11 +00:00
parent bef0503545
commit 4aee4c1ac7

View File

@ -805,6 +805,7 @@ snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr,
/* peek in the UDP header (goto IP payload) */
if(pbuf_header(p, UDP_HLEN)){
LWIP_ASSERT("Can't move to UDP header", 0);
pbuf_free(p);
return;
}
udphdr = p->payload;