Add cares for malloc failed.