Advertisement
Guest User

Untitled

a guest
Jan 18th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int main() {
  5.     int i = 0;
  6.     while (1) {
  7.         void *x = malloc(1024);
  8.         if (!x) {
  9.             fprintf(stderr, "malloc returned NULL after allocated %dK\n", i);
  10.             return 0;
  11.         }
  12.         i++;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement