We read in Al-Fatāwā al-Ḥadīthiyyah by Ibn Hajar al-Haytami, page 69:
"Scholars differed regarding the permissibility of marrying them (the jinn) according to Sharia. It is reported from Mālik (may Allah be pleased with him) that he allowed it, but he disliked it so that a woman claiming to be pregnant from adultery would not be attributed to a jinn."