Closing the file when cant alloc the memory for the content