blob: 70a13ee0ca82e69b21a9be79f852f6f32fb605bb [file] [log] [blame]
/* Compare a string that has been freed and
one that is valid. */
#include <stdlib.h>
#include <string.h>
#define BUFSZ (100000 * sizeof(char))
int main()
{
char *buf1, *buf2;
buf1 = malloc(BUFSZ);
strcpy(buf1, "A string");
free(buf1);
buf2 = malloc(BUFSZ);
strcpy(buf2, "Another string");
if (strcmp(buf1, buf2) == 0)
return 1;
free(buf2);
return 0;
}