mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 12:24:22 +00:00
Free pbuf if pbuf_header() fails
This commit is contained in:
parent
bef0503545
commit
4aee4c1ac7
@ -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) */
|
/* peek in the UDP header (goto IP payload) */
|
||||||
if(pbuf_header(p, UDP_HLEN)){
|
if(pbuf_header(p, UDP_HLEN)){
|
||||||
LWIP_ASSERT("Can't move to UDP header", 0);
|
LWIP_ASSERT("Can't move to UDP header", 0);
|
||||||
|
pbuf_free(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
udphdr = p->payload;
|
udphdr = p->payload;
|
||||||
|
Loading…
Reference in New Issue
Block a user