If you picked up a free Krispy Kreme doughnut for wearing your 'I Voted' sticker, you broke a federal law.

Many local businesses are offering freebies for Election Day. In West Sacramento, Stockton and Modesto, Krispy Kreme is handing out free doughnuts to voters who flash their sticker. 7-Eleven is giving away a free coffee in any size, redeemable through the 7-11 app.

One of these businesses is breaking the law, one isn't.

Under U.S. Code 597, businesses can't offer a reward for voting.

Whoever makes or offers to make an expenditure to any person, either to vote or withhold his vote, or to vote for or against any candidate; and whoever solicits, accepts, or receives any such expenditure in consideration of his vote or the withholding of his vote— shall be fined under this title or imprisoned not more than one year, or both; and if the violation was willful, shall be fined under this title or imprisoned not more than two years, or both.

In a nutshell, you can be fined or face up to a year in jail, or both, for handing out or receiving freebies related to voting.

The law states that if there's intent behind the freebie, jail time could be up to two years.

If a business, such as Krispy Kreme asks that a person be wearing an 'I Voted' sticker, they're breaking the law because the free product is limited to voters only.

To get around this law on Election Day, businesses simply have to offer their promotion to all guests instead of only those who show they voted. Since 7-Eleven is offering their free coffee to all customers, they're technically within the law.