Allaah has permitted intimacy with a slave woman if the man owns her. This is not regarded as adultery as suggested in the question. Allaah says, describing the believers (interpretation of the meaning):
“those who guard their chastity (i.e. private parts, from illegal sexual acts)
Except from their wives or (the slaves) that their right hands possess,__ for then, they are free from blame”
What is meant by “those whom their right hands possess” is slave women or concubines. See also question no. 10382, 12562.
Once this is understood, it should be noted that what is suggested in the question, that this was zina, never occurred to the Sahaabah (may Allaah be pleased with them). What they were asking about was the ruling on practicing ‘azl with the slave women whom they had acquired in the course of jihad.