I almost slept with my friend's ex-boyfriend
Does it worry you that your friend may get mad at you for this?
I do not think my friend would get mad.
As long as your friend would approve, it would be ok to sleep with him. If he is not going out with anyone at this time, there is nothing wrong with it.
She won't get mad, I'm going to make sure of that.
If the person is single than you are ok to sleep with that person. Still run it by your friend though just because that is the right thing to do in this particular situation.