1
0
Fork 0
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:
Stefan Lankes 2017-09-21 22:13:21 +02:00
parent a2b88521bc
commit 4906a04022

View file

@ -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);