// 24T3 Week 7 Lecture 1 // An example of creating a memory leak // on purpose #include #include int main(void) { int i = 0; while(1) { printf("%d\n", i); int *data = malloc(1000000 *sizeof(int)); if (data == NULL) { printf("Out of memory\n"); return 0; } i++; free(data); } return 0; }