Abis bin Rabi'ah (may Allah have mercy on him) said that Sayyiduna Ali (may Allah be pleased with him) said: "Every divorce is valid except the divorce of the mentally deranged (ma'tuh)."
(b) Al-Sha'bi, al-Hasan and Ibrahim (may Allah have mercy on them) all said that a child's divorce and freeing of a slave are not valid until he reaches puberty.
(c) Jabir bin Zayd, Ibrahim and Abu Qilabah (may Allah have mercy on them) did not consider valid the divorce of a person suffering from a lung disease (birsam). Al-Sha'bi and Ibrahim (may Allah have mercy on them) said about a person who divorces and frees a slave in his sleep: "It is nothing."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 15110