immediately handle a memory allocation failure so the rest of the function