The wrong client
In the 2011 film, Mickey (Matthew McConaughey) agrees to defend Louis Roulet, a rich playboy accused of assault. Bit by bit he realizes Roulet also committed an old murder that Jesus Martinez, a former client of Mickey's, is locked up for. Roulet admits it, knowing privilege ties the lawyer's hands.
After investigator Frank Levin is killed, Mickey finds the bullet came from his late father's antique pistol. In court he gets Roulet off the current charge but nails him for the old crime with help from his ex-wife, Maggie McPherson.
In the end, Roulet's mother, Mary Windsor, confesses to killing Levin and shoots Mickey, who kills her when she tries to fire again. Martinez goes free, and Mickey takes a biker gang's case pro bono.