Skip to content

Commit

Permalink
gnrc_pktbuf_static.c: do not free pktbuf if pkt->size is less then or…
Browse files Browse the repository at this point in the history
… equal to aligned_size
  • Loading branch information
jfischer-no committed Dec 23, 2015
1 parent 7350062 commit e78dbd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ int gnrc_pktbuf_realloc_data(gnrc_pktsnip_t *pkt, size_t size)
pkt->data = new_data;
}
else {
_pktbuf_free(((uint8_t *)pkt->data) + aligned_size,
pkt->size - aligned_size);
if (_align(pkt->size) > aligned_size) {
_pktbuf_free(((uint8_t *)pkt->data) + aligned_size,
pkt->size - aligned_size);
}
}
pkt->size = size;
mutex_unlock(&_mutex);
Expand Down

0 comments on commit e78dbd3

Please sign in to comment.