client: more malloc checks