mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #4022 from OlegHahm/pktbuf_fixes
pktbuf: release correct snip in error case
This commit is contained in:
commit
df9457bd02
@ -634,7 +634,7 @@ static void _send(gnrc_pktsnip_t *pkt, bool prep_hdr)
|
||||
|
||||
if (gnrc_netapi_receive(gnrc_ipv6_pid, rcv_pkt) < 1) {
|
||||
DEBUG("ipv6: unable to deliver packet\n");
|
||||
gnrc_pktbuf_release(pkt);
|
||||
gnrc_pktbuf_release(rcv_pkt);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -395,7 +395,7 @@ static void *_pktbuf_alloc(size_t size)
|
||||
{
|
||||
_unused_t *prev = NULL, *ptr = _first_unused;
|
||||
size = (size < sizeof(_unused_t)) ? _align(sizeof(_unused_t)) : _align(size);
|
||||
while (ptr && size > ptr->size) {
|
||||
while (ptr && (size > ptr->size)) {
|
||||
prev = ptr;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user