c - Segmentation fault with calloc -


i saw lot forum ask, in answers because don't verify returned pointer. in case, i'm working on embedded system (so no valgrind or gdb), , debug printf… there program make segfault :

void myfunction(…) {     cam_t *n = null;     /* code */     printf("before calloc\n");     n = calloc(1, sizeof *n);     printf("calloced\n");     /* rest of code */ } 

when run i've got :

before calloc segmentation fault 

does have suggestion in why i've fault ?

thanks !


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -