Handle malloc failure