If you did not intentionally omit the sin, it is forgiven, however you should still confess it the next time you go to confession.
There is a problem in the spiritual life called scruples. Martin Luther and St. Ignatius Loyola both suffered from it. There was a big difference between the two however. St. Ignatius was able to overcome scruples, whereas Martin Luther never did. Scruples is the worry or fear that everything we do is sinful and God cannot or will not forgive us. St. Ignatius was able to find confidence that God’s grace was capable of forgiving us through the means He gave us in the sacrament of Penance. Martin Luther was always fearful of a God who would reject him as a reprobate, he even refered to the souls of men as dung heaps. The Catholic sees God as our Father, (as our Lord taught us) who while we are indeed sinful are adopted and helped by His grace to improve ourselves and come to love Him more fully by cooperation with His grace. The Protestant sees man as reprobate, unworthy of salvation, and that God overlooks our stench and somehow lets us slip through the gates of heaven.
If someone is in danger of death, he can make a perfect act of contrition. There are two types of contrition, imperfect, in which we are sorry for our sins because we are fearful of divine justice, and the fires of hell. Perfect is sorrow for our sins because they offend God. While if we are contrite (sorry for our sins) even if imperfectly and confess to a priest with jurisdiction to absolve, we are assured by Christ’s promise “Who’s sins you forgive they are forgiven, who’s sins you retain they are retained” that our sins are forgiven. God will not withold forgiveness to us if we die without a priest at hand to grant us absolution if we are truly contrite. God has given us the ordinary means, (the sacraments and the authority he gave to the Church) and extraordinary means of salvation, all based on the Passion, Death and Resurrection of our Lord.