mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-07-10 21:31:56 +00:00
15 lines
222 B
C
15 lines
222 B
C
#include <malloc.h>
|
|
|
|
size_t malloc_object_size(void *ptr);
|
|
|
|
__attribute__((optimize(0)))
|
|
int main() {
|
|
void *p = malloc(16);
|
|
if (!p) {
|
|
return 1;
|
|
}
|
|
free(p);
|
|
malloc_object_size(p);
|
|
return 0;
|
|
}
|