It is narrated from Salim bin Abdullah (may Allah have mercy on him) that Ubaidullah (may Allah have mercy on him) used to say: "It is not permissible for any woman to spend even a single night outside her home during the waiting period ('iddah) after her husband's death or divorce."
Hadith Referenceمسند الإمام الشافعي / كتاب العدد والسكنى والنفقات / 1327
Hadith Takhrijصحيح اخرجة البيهقي : 436/7 - وفى المعرفة السنن والآثار له (4674) - ومالك في الموطأ، الطلاق، باب مقام المتوفى عنها زوجها في بيتها حتى تحل۔