DS had that happen once, too. Very dark yellow. I took him to the ER because he'd had abdominal surgery after birth and I was worried about intestinal blockage, but it turned out he was fine.
I'd call the doctor if it happens more than once and he hasn't pooped recently. It could point to a blockage in the intestinal tract.
If it happened only once and he seems to be handling food OK after that, then I wouldn't worry.