add error checking after call to malloc in team_createplayer

Add an if statement to check if the value returned by malloc is NULL.