Skip to content

Commit

Permalink
Merge pull request #4022 from OlegHahm/pktbuf_fixes
Browse files Browse the repository at this point in the history
pktbuf: release correct snip in error case
  • Loading branch information
OlegHahm committed Oct 2, 2015
2 parents 10bddd5 + f2e7845 commit df9457b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit df9457b

Please sign in to comment.