It is unfair to Leonard to ask this question. It should not be considered a knock on Leonard that he would be demolished if he fought Foster. Foster had to be the most devastating light heavyweight puncher of all time and he was an excellent all-around fighter as well. Leonard was really a 147 pounder and Foster a 6' 3" 175 pounder.
Basically we have a top 5 H2H natural welterweight vs a top 5 H2H natural light heavyweight. That is all that need be said.
Added to this the greatest ever natural Welterweight (SRR, who actually grew into 160 better than Leonard and did way more there) couldn't beat Maxim who imo is far far less dangerous to a smaller fighter than Bob.
Leonard's record at 160 consists of a dubious win over Hagler, where he demanded 12 instead of the usual 15 rounds, a clear loss (which he admitted) against Hearns, despite getting the draw, and a win over an ancient Duran. His only serious success North of 160 was Lalonde. And he weight drained Lalonde for the 168 lb title. The 175 should not have been on the line. Bob Foster would have been a ridiculous mismatch at 175. Leonard would have been lucky to last 5 rounds.