The case involves 21-year-old Timothy Caudill.
He was held in a residential community corrections program last year for breaking into a bar.
Prosecutors say he bought the oatmeal creme pie from a vending machine and shared it with a fellow inmate who was on restriction and wasn't allowed access to snacks.
Prosecutors have asked a judge to revoke Caudill's probation and put him in prison for nine months, which his attorney calls outrageous.