According to Senate rules, profanity is not permitted in the chamber. But when the exchange occurred between Leahy and Cheney, the Senate was not in session so there was technically no foul.
Technicality or not I don’t think that’s any way for a vice president to act.