1
0
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:
Oleg Hahm 2015-10-02 14:58:59 +02:00
commit df9457bd02
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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;
}