The alloca function dynamically allocates memory on the stack. Unlike malloc, it does not return NULL if it is unable to allocate the memory. If it was unable to allocate the memory, attempting to use it will result in undefined behavior, most likely a crash.