If not before, then right then he should have been pulled off duty.
He should have been fired and charged with passing contraband to an inmate.