mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
remove memory leak
- free packet buffer if the packet is dropped
This commit is contained in:
parent
a2b88521bc
commit
4906a04022
1 changed files with 5 additions and 3 deletions
|
@ -215,11 +215,13 @@ static void uhyve_netif_poll(void)
|
|||
#endif
|
||||
|
||||
|
||||
//forward packet to LwIP
|
||||
if (tcpip_callback_with_block(consume_packet, p, 0) == ERR_OK)
|
||||
//forward packet to the IP thread
|
||||
if (tcpip_callback_with_block(consume_packet, p, 0) == ERR_OK) {
|
||||
LINK_STATS_INC(link.recv);
|
||||
else
|
||||
} else {
|
||||
LINK_STATS_INC(link.drop);
|
||||
pbuf_free(p);
|
||||
}
|
||||
} else {
|
||||
LOG_ERROR("uhyve_netif_poll: not enough memory!\n");
|
||||
LINK_STATS_INC(link.memerr);
|
||||
|
|
Loading…
Add table
Reference in a new issue