blob: 90624f222b26a009c985b64597786a7d89f20385 [file] [log] [blame]
/* Access a validly allocated pointer through a freed one. */
#include <stdlib.h>
#include <string.h>
typedef struct
{
char *string;
int u;
} example;
void access(example *e)
{
strcpy(e->string, "String");
}
int main()
{
example *e;
e = malloc(sizeof(example));
e->string = malloc(sizeof(char) * 1000);
free(e);
access(e);
return 0;
}