blob: fa1994caf7b283478d01895d445cefc4ac58b56d [file] [log] [blame]
/* Iterate 1000000 times freeing and allocating a pointer
each time. Double free another pointer at the end. */
#include <stdlib.h>
#define ASZ 1000
int main()
{
char *a, *b;
int i, j;
a = malloc(sizeof(char));
free(a);
for (i = 0; i < ASZ; i++)
{
b = a;
for (j = 0; j < ASZ; j++)
{
b = malloc(sizeof(char));
free(b);
}
}
free(a);
return 0;
}