blob: 9b182153284404ad74403a13e71b0bc7cc1d7500 [file] [log] [blame]
/* Allocate and free an array. Do that 10 times inside a loop.
After the loop is done, try to write to the first allocated item. */
#include <stdlib.h>
#define SZ 1000
int main()
{
int *a, *b, i;
a = malloc(sizeof(int) * SZ);
free(a);
for (i = 0; i < 10; i++)
{
b = malloc(sizeof(int) * SZ);
free(b);
}
*a = i;
return 0;
}