mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
22 lines
199 B
C
22 lines
199 B
C
|
|
#include <stdlib.h>
|
|
|
|
int* mk_dangle(void)
|
|
{
|
|
int* x = malloc(400);
|
|
free(x);
|
|
|
|
return x;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
int y;
|
|
int* x = mk_dangle();
|
|
|
|
y = x[5];
|
|
y = x[-1];
|
|
|
|
return 0;
|
|
}
|