I would suggest you review your lease terms. When you signed the agreement did you pay first, last and security? That may be the case. Also keep in mind in some states it is actually illegal to withhold the last month's rent. Depending upon what state you are in I would make sure you could do it.
The best thing to do is to contact your landlord and communicate what you propose. It is doubtful that the landlord would spend the time and money going after you for the rent when he has the deposit however legally he/she is obligated to provide you with an accounting of the deposit and outline charges against same upon your lease expiration. Again states have different laws in the regard.
I hope this helps and good luck.