Help so worried :(

I made up a bottle with formula and fed it to my month old baby, he left a bit in it and about 4 or 50 minutes later he was looking more bottle so I gave him what was in the bottle there was about an oz or not even but then I started to think the milk was bad and I smelt It and it smelt rotten like it was sour, I am so paranoid now I'm sure the milk was bad. What could this do to my baby? Also on the container of formula it says the it has to be thrown out at 2 hours so why was the milk bad?? :(