The state’s highest court in Albany this week upheld a state police vehicle impoundment policy that, in the case of a Buffalo man, led to his arrest on a weapon possession charge after police searched the car before towing it away.

A state trooper pulled over Samuel Walker in Buffalo in 2009 when he saw that the passenger in the car, who was Walker’s girlfriend, was not wearing a seat belt. Police found Walker’s license had been revoked, and he was arrested. The trooper then prepared the vehicle to be impounded by searching it to make an inventory list of items when he discovered a loaded handgun behind the passenger seat.

Walker, who later pleaded guilty to the weapons charge and was sentenced to 3½ years in prison, argued that the police should have asked if his passenger was licensed to drive the car away from the scene before trying to impound it, a process that led to the weapon being discovered.

“We hold that no such inquiry was necessary,” the Court of Appeals ruled, upholding two prior court defeats for Walker in the case.