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:
parent
a04b0a01a2
commit
c95e8553ef
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user