No officer shall, by color of his office, take any obligation of or for any person in his custody, otherwise than is directed by law.
Code 1950, § 15-513; 1962, c. 623, § 15.1-78; 1997, c. 587.