// use-after-free #include #include #include int main() { int *ptr = malloc(sizeof(*ptr)); assert(ptr); *ptr = 42; free(ptr); printf("%d\n", *ptr); // use after free *ptr = 43; // use after free return 0; }