blob: 07aa0d0ab467479fbf81941d710ceabac1a9f6fd [file] [log] [blame]
/* Accessing valid memory through a free'd pointer */
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
typedef struct
{
char *mem;
} test;
int main()
{
jmp_buf buf;
test *t;
t = malloc(sizeof(test));
t->mem = malloc(1000);
if (setjmp(buf) != 0)
strcpy(t->mem, "String");
else
{
free(t);
longjmp(buf, 1);
}
return 0;
}