mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/net/gnrc_pktbuf: fail assertion if illegal memory was freed
This commit is contained in:
parent
c636f34eac
commit
278e8f53b7
@ -465,7 +465,12 @@ void gnrc_pktbuf_free_internal(void *data, size_t size)
|
|||||||
size_t bytes_at_end;
|
size_t bytes_at_end;
|
||||||
_unused_t *new = (_unused_t *)data, *prev = NULL, *ptr = _first_unused;
|
_unused_t *new = (_unused_t *)data, *prev = NULL, *ptr = _first_unused;
|
||||||
|
|
||||||
|
if (data == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!gnrc_pktbuf_contains(data)) {
|
if (!gnrc_pktbuf_contains(data)) {
|
||||||
|
assert(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user