Psalms 18:23 (KJV)

I was also upright before him, and I kept myself from mine iniquity.