Police: Man buys beer, leaves baby behind