Still missing check for allocation success.