print an error and spin
Use calloc to allocate memory