I'm a junior software developer in a small company. I'm working on a project since I finished my internship contract 4 months ago. It's a small project, so there's only another programmer (junior too but with ~3 years of experience) and the project leader, who doesn't even see the code. Every time the client finds a bug, the project leader informs both of us because he doesn't know who made the mistake.
The problem is that whenever he informs us about a bug, my colleague tells him it was my fault, without even checking if that's true, and sometimes the project leader speaks to the company boss. Then, when I go to source code to find out where the problem is, I usually discover that he wrote that specific piece of code (thanks to git commit history), but as it is not inmediate, I cannot defend myself.
The thing is that I'm not really sure that the other developer does it intentionally because it's easy to blame the "boy without programming experience who doesn't know how to do things right", or if he really thinks the errors were mine because of the same reason and that he doesn't remember which parts of the project he wrote.
In any case, what can I do to show my project leader and my boss that most of the errors I'm blamed for are not mine without accusing him explicitly? I fear for my future promotions and the opinion of my boss about me.