Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's very easy to make malloc return NULL:

  % ulimit -v 80000
  
  % cat test.c
  #include <stdio.h>
  #include <stdlib.h>
  
  int main(void) {
    char *p = malloc(100'000'000);
    printf("%p\n", p);
  }
  
  % cc test.c
  
  % ./a.out
  (nil)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: