A lot of landlords do not cooperate in instances like this and insist on being paid for the full term then go out and find their own tenant. Win-win for the landlord. He who baulks first wins.
If the landlord insists on being paid the full term then he should not be handed back the keys until the term is completed. Let his apartment sit empty and then sue him if he tries to sub let while an enforced contract is still in place.