Whether or not the leak causing carpet to mildew in the rental you have is deemed an unsanitary living condition is best addressed by your local health department. I would write the landlord a note (keep a copy of it for future reference) advising him or her that if the leak is not fixed by a certain date that you will have the local health department inspect the unit concerning the conditions you have written about.