Handle malloc failures.