Nothing But the Truth
(2008)

Kate Beckinsale plays Rachel, a reporter who publishes an article revealing the identity of a CIA agent. The agent is a woman who has a small daughter attending the same elementary school as Rachel's boy.

A judge declares that because of national security she has to reveal the name of the traitor who gave away the agent's identity. Rachel refuses and goes to jail for a year; the same day she is released she is aprehended again and sentenced, after a plea-bargain, to 2 years.

Meanwhile her husband has abandoned her and her child became distant. As she is being taken to jail she remembers the moment she learned about the agent, it was the woman's daughter in a casual conversation in the school bus.

Thanks Jose!