web: home-page: Add new page
[lcapit-junk-code.git] / leak.c
blobdb71c6fe2e4744c95d5d4f619a2c14586a6a37b8
1 /*
2 * Leaks memory in SIZE chunks
3 */
4 #include <stdio.h>
5 #include <string.h>
6 #include <stdlib.h>
8 #define SIZE (1024 * 1024)
10 int main(void)
12 char *p;
14 for (;;) {
15 p = malloc(SIZE);
16 if (!p) {
17 perror("malloc()");
18 exit(1);
20 memset(p, 0, SIZE);
23 return 0;