-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
@@ -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; |
There was a problem hiding this comment.
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. ;)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ;-)
@authmillenon done |
ACK, please squash. |
& go. |
sys/net/gnrc/conn/gnrc_conn.c: release pkt in gnrc_conn_recvfrom
Can you PR a version of this fix to the release branch too, please. |
ok |
Add gnrc_pktbuf_release to gnrc_conn_recvfrom.
It fixes pkt memory leak what I have observed in #4189.