1
0
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:
Benjamin Valentin 2024-11-14 15:27:05 +01:00
parent c636f34eac
commit 278e8f53b7

View File

@ -465,7 +465,12 @@ void gnrc_pktbuf_free_internal(void *data, size_t size)
size_t bytes_at_end;
_unused_t *new = (_unused_t *)data, *prev = NULL, *ptr = _first_unused;
if (data == NULL) {
return;
}
if (!gnrc_pktbuf_contains(data)) {
assert(0);
return;
}