They Went That A Way That A Way (1978)
Small town deputy is ordered by the governer to go undercover, posing as a criminal, in a maximum security prison Shortly after his mission begins, the governor dies, leaving him and his partner stranded in jail