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

sys/net/gnrc/conn/gnrc_conn.c: release pkt in gnrc_conn_recvfrom #4207

Merged
merged 1 commit into from
Nov 2, 2015
Merged

sys/net/gnrc/conn/gnrc_conn.c: release pkt in gnrc_conn_recvfrom #4207

merged 1 commit into from
Nov 2, 2015

Conversation

jfischer-no
Copy link
Contributor

Add gnrc_pktbuf_release to gnrc_conn_recvfrom.
It fixes pkt memory leak what I have observed in #4189.

@jfischer-no jfischer-no added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking labels Nov 2, 2015
@@ -83,6 +83,7 @@ int gnrc_conn_recvfrom(conn_t *conn, void *data, size_t max_len, void *addr, siz
*addr_len = _srcaddr(addr, l3hdr);
}
memcpy(data, pkt->data, pkt->size);
gnrc_pktbuf_release(pkt);
return pkt->size;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is now invalid. ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a pity, but in principle is it a right place for gnrc_pktbuf_release?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you just have to store the value before release ;-)

@jfischer-no
Copy link
Contributor Author

@authmillenon done

@miri64
Copy link
Member

miri64 commented Nov 2, 2015

ACK, please squash.

@miri64 miri64 added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Nov 2, 2015
@jfischer-no jfischer-no added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable labels Nov 2, 2015
@miri64
Copy link
Member

miri64 commented Nov 2, 2015

& go.

miri64 added a commit that referenced this pull request Nov 2, 2015
sys/net/gnrc/conn/gnrc_conn.c: release pkt in gnrc_conn_recvfrom
@miri64 miri64 merged commit 7b05964 into RIOT-OS:master Nov 2, 2015
@jfischer-no jfischer-no deleted the fix@gnrc_conn_recvfrom branch November 2, 2015 15:23
@miri64
Copy link
Member

miri64 commented Nov 2, 2015

Can you PR a version of this fix to the release branch too, please.

@jfischer-no
Copy link
Contributor Author

ok

@jfischer-no jfischer-no restored the fix@gnrc_conn_recvfrom branch November 2, 2015 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants