If you have a 12 month contract with no clause about leaving early, legally speaking you are on the hook for the full 12 months- however most landlords would not bother filing police reports and taking you to court over it and would just take the deposit.
Not really much point for landlords having year contracts, which presumably you negotiate at lower rental, if you can just walk away early. May as well just do month by month.