check host malloc result
Merge pull request #1585 from longjon/check-malloc

Check host malloc result