Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnrc_tcp leaks memory when gnrc_netapi_send fails #12081

Closed
nmeum opened this issue Aug 26, 2019 · 1 comment · Fixed by #12131
Closed

gnrc_tcp leaks memory when gnrc_netapi_send fails #12081

nmeum opened this issue Aug 26, 2019 · 1 comment · Fixed by #12131
Assignees
Labels
Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@nmeum
Copy link
Member

nmeum commented Aug 26, 2019

gnrc_tcp uses gnrc_netapi_send in two places:

gnrc_netapi_send(gnrc_tcp_pid, reset);

gnrc_netapi_send(gnrc_tcp_pid, out_pkt);

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:

if (gnrc_netapi_send(netif->pid, pkt) < 1) {
DEBUG("ipv6: unable to send packet\n");
gnrc_pktbuf_release(pkt);
}

This shouldn't be a big issue as gnrc_netapi_send only fails when msg_try_send fails this is just a minor issue I noticed while debugging #12001.

@miri64 miri64 added Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Aug 28, 2019
@miri64 miri64 added this to the Release 2019.10 milestone Aug 28, 2019
@brummer-simon
Copy link
Member

I'll look into it on the Weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants