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
Post a Comment