1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/heap_cmd: fix -Wuse-after-free

Strictly speaking, this is not actually a use after free, as only the
address of the freed memory chunk is printed. The freed memory is not
accesses. However, this is more idiomatic this way.
This commit is contained in:
Marian Buschsieweke 2022-09-16 08:12:22 +02:00
parent a04b0a01a2
commit c95e8553ef
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -43,8 +43,8 @@ static int free_cmd(int argc, char **argv)
unsigned int p = strtoul(argv[1], NULL, 16);
void *ptr = (void *)p;
printf("freeing %p\n", ptr);
free(ptr);
printf("freed %p\n", ptr);
return 0;
}