exit on malloc failure