gnrc_tcp leaks memory when gnrc_netapi_send fails #12081
Labels
Area: network
Area: Networking
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Milestone
gnrc_tcp
usesgnrc_netapi_send
in two places:RIOT/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_eventloop.c
Line 221 in 20dec77
RIOT/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_pkt.c
Line 274 in 45989aa
Unfortunately, the return value isn't checked and it seems to me that the caller is responsible for freeing the pktbuf memory on error. As an example: Consider how
gnrc_ipv6
handles this:RIOT/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Lines 262 to 265 in 7f2cc4f
This shouldn't be a big issue as
gnrc_netapi_send
only fails whenmsg_try_send
fails this is just a minor issue I noticed while debugging #12001.The text was updated successfully, but these errors were encountered: