if it is doing it overnight that means you have a leak somewhere in the car,and the rear defroster part that isn't working could be a bad relay for it or a broken spot in the little lines that run across it,the leak will be a lot harder to find and repair that than rear defroster,it will either be a fuse, or a relay or broken spot on the glass where the lines are,if that's the case you may have to replace the glass if the lines cant be repaired,take a 12 volt test light and turn the defroster on and check for power at the two post where the wires connect to the rear glass this will help you determine if its getting power to it,if it isn't check the relay or the fuse ,good luck.